ObjectId class
Constructors
- ObjectId()
- Generates an ObjectId instance with the actual seconds
- ObjectId.fromBsonBinary(BsonBinary id)
- ObjectId.fromBuffer(BsonBinary buffer)
- ObjectId.fromHexString(String hexString)
-
factory
- ObjectId.fromSeconds(int seconds)
- Generates an ObjectId instance with the seconds required
- ObjectId.parse(String hexString)
-
Generates an ObjectId instance from an hex string
If the string is not valid throws an ArgumentError
factory
Properties
- $oid → String
-
no setter
- dateTime → DateTime
-
Equivalent to mongo shell's "getTimestamp".
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → BsonBinary
-
no setter
- incrementHex → String
-
Increment Hex part
no setter
- incrementPart → int
-
Increment int part
no setter
- oid → String
-
Returns the hexadecimal string representation of this ObjectId
no setter
- randomHex → String
-
Randox Hex part
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHexString(
) → String - Same as oid.
-
toJson(
) → String -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- classIncrementHex ↔ String
-
getter/setter pair
- classRandomHex → String
-
final
Static Methods
-
createId(
int seconds) → BsonBinary - creates a BsonBinary representation of this ObjectId with the given number of seconds sinceEpoch
-
extractData(
BsonBinary buffer) → BsonBinary -
isValidHexId(
String hexString) → bool - Check if it is a valid hexString (hex chars and length 24)
-
tryParse(
String hexString) → ObjectId? - Generates an ObjectId instance from an hex string If the string is not valid returns null