# Class: FindOptions

# Hierarchy

  • FindOptions

# Implements

# Constructors

# constructor

+ new FindOptions(data: FindOptions): FindOptions

Parameters:

Name Type
data FindOptions

Returns: FindOptions

# Properties

# Optional consistency

consistency? : SearchConsistency

Implementation of IFindOptions.consistency


# Optional ignoreCase

ignoreCase? : undefined | false | true

Implementation of IFindOptions.ignoreCase


# Optional lean

lean? : undefined | false | true

Implementation of IFindOptions.lean

Documents returned from queries with the lean option enabled are plain javascript objects, not Ottoman Documents. They have no save methods, hooks or other Ottoman Document's features.

example

const document = await UserModel.findById(id, { lean: true });
document instanceof Document; // false
1
2

# Optional limit

limit? : undefined | number

Implementation of IFindOptions.limit


# Optional noCollection

noCollection? : undefined | false | true

Implementation of IFindOptions.noCollection


# Optional populate

populate? : PopulateFieldsType

Implementation of IFindOptions.populate


# Optional populateMaxDeep

populateMaxDeep? : undefined | number

Implementation of IFindOptions.populateMaxDeep


# Optional select

select? : ISelectType[] | string | string[]

Implementation of IFindOptions.select


# Optional skip

skip? : undefined | number

Implementation of IFindOptions.skip


# Optional sort

sort? : Record‹string, SortType

Implementation of IFindOptions.sort