Metadata class

文件信息

Constructors

Metadata({ObjectId? id, ObjectId? bsid, int? time, DbJsonWraper? extra, ObjectId? uid, int? type, String? path, int? size, bool? removed})
Metadata.fromJson(Map<String, dynamic> map)
factory
Metadata.fromString(String data)
factory

Properties

bsid ObjectId
商户id
no setter
extra DbJsonWraper
自定义数据
no setter
hashCode int
The hash code for this object.
no setterinherited
id ObjectId
唯一id
no setter
path String
文件保存的路径
getter/setter pair
removed bool
文件是否已经删除
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
文件的字节大小
getter/setter pair
time int
创建时间
no setter
type int
文件类型
getter/setter pair
uid ObjectId
上传者的用户id
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
转换为基本数据类型的Map。转换结果可以直接使用jsonEncode进行序列化,可以直接保存到mongo数据库
toKValues() Map<String, dynamic>
转换为用字符串key读取字段值的Map
toString() String
jsonEncode(this)抛出的异常被吃掉了,所以需要写成jsonEncode(toJson())
updateByJson(Map<String, dynamic> map, {Metadata? parser}) → void
通过基本数据类型的Map来更新字段。来源map可以直接使用jsonEncode进行序列化,可以直接保存到mongo数据库
updateByKValues(Map<String, dynamic> map) → void
通过用字符串key读取字段值的Map来更新字段

Operators

operator ==(Object other) bool
The equality operator.
inherited