insertOne method

Future<ObjectId> insertOne(
  1. MongoDocument document
)

Inserts the provided document to the collection

Implementation

Future<ObjectId> insertOne(MongoDocument document) async {
  var result = await FlutterMongoRealm.insertDocument(
    collectionName: this.collectionName,
    databaseName: this.databaseName,
    data: document.map,
  );
  return ObjectId.fromHexString(result);
}