FindOperation constructor

FindOperation(
  1. DbCollection collection, {
  2. Map<String, dynamic>? filter,
  3. Map<String, Object>? sort,
  4. Map<String, Object>? projection,
  5. String? hint,
  6. Map<String, Object>? hintDocument,
  7. int? skip,
  8. int? limit,
  9. FindOptions? findOptions,
  10. Map<String, Object>? rawOptions,
})

Implementation

FindOperation(DbCollection collection,
    {this.filter,
    this.sort,
    this.projection,
    this.hint,
    this.hintDocument,
    this.skip,
    this.limit,
    FindOptions? findOptions,
    Map<String, Object>? rawOptions})
    : super(collection.db,
          <String, Object>{...?findOptions?.options, ...?rawOptions},
          collection: collection, aspect: Aspect.readOperation) {
  if (skip != null && skip! < 1) {
    throw MongoDartError('Skip parameter must be a positive integer');
  }
  skip ??= 0;
  if (limit != null && limit! < 0) {
    throw MongoDartError('Limit parameter must be a non-negative integer');
  }
  limit ??= 0;
}