BsonObjectId class

Represents a BSON ObjectId type in Firestore documents.

Only databases of the Enterprise edition store this type.

await firestore.doc('users/ada').set(<String, Object?>{
  'legacyId': const BsonObjectId('507f191e810c19729de860ea'),
});
final DocumentSnapshot<Map<String, Object?>> snapshot =
    await firestore.doc('users/ada').get();
final BsonObjectId? id = snapshot.getBsonObjectId('legacyId');

ObjectIds sort by their string. Two are equal when their strings are equal.

Constructors

BsonObjectId(String value)
Creates an ObjectId from its 24-character hex string representation.
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → String
The 24-character hex string representation of the ObjectId.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override