## Index

### Classes

- Aggregation
- BaseStore
- BinaryParser
- BinaryParserBuffer
- Clause
- Collection
- Connection
- ConnectionHelper
- Cursor
- Document
- EventEmitter
- MongoPortable
- ObjectId
- Options
- Selector
- SelectorMatcher
- Utils

### Interfaces

- IAbstractStore

### Variables

- MACHINE_ID
- checkForHexRegExp
- chr
- database
- maxBits
- pid

### Functions

- _applyModifier
- _ensureFindParams
- _getDocuments
- _mapFields
- _modify
- _testClause
- _testLogicalClause
- _testObjectClause
- _testOperatorClause
- _testOperatorConstraint
- do_complex_group
- do_group
- do_match
- do_project
- do_single_group
- do_sort
- getObjectSize
- hasSorting
- isValidHexRegExp

### Object literals

- BsonTypes
- _modifiers
- group_operators
- stages

## Variables

### MACHINE_ID

MACHINE_ID: number = parseInt(`${Math.random() * 0xFFFFFF}`, 10)

- Defined in document/ObjectId.ts:15

Machine id.

Create a random 3-byte value (i.e. unique for this process). Other drivers use a md5 of the machine id here, but that would mean an asyc call to gethostname, so we don"t bother.

ignore

### checkForHexRegExp

checkForHexRegExp: RegExp = new RegExp("^[0-9a-fA-F]{24}$")

- Defined in document/ObjectId.ts:18

### chr

chr: fromCharCode = String.fromCharCode

- Defined in binary/BinaryParser.ts:7

### database

database: any = null

- Defined in collection/Collection.ts:48

Collection

module

  Collection

constructor
since

  0.0.1

author

  Eduardo Astolfi eastolfi91@gmail.com

copyright

  2016 Eduardo Astolfi eastolfi91@gmail.com

license

  MIT Licensed

classdesc

  Collection class that maps a MongoDB-like collection

### maxBits

maxBits: Array<any> = []

- Defined in binary/BinaryParser.ts:9

### pid

pid: number = Math.floor(Math.random() * 100000)

- Defined in document/ObjectId.ts:25

## Functions

### _applyModifier

- _applyModifier(_docUpdate: any, key: any, val: any): any

- - Defined in collection/Collection.ts:1091

  #### Parameters

  - ##### _docUpdate: any

  - ##### key: any

  - ##### val: any

  #### Returns any

### _ensureFindParams

- _ensureFindParams(params: any): any

- - Defined in collection/Collection.ts:1374

  #### Parameters

  - ##### params: any

  #### Returns any

### Private _getDocuments

- _getDocuments(cursor: any, justOne?: boolean): any

- - Defined in collection/Cursor.ts:601

  Retrieves one or all the documents in the cursor

  #### Parameters

  - ##### cursor: any

    The cursor with the documents

  - ##### Default value justOne: boolean = false

  #### Returns any

  If [justOne=true] returns the next document, otherwise returns all the documents

### _mapFields

- _mapFields(doc: any, fields: any): any

- - Defined in collection/Cursor.ts:526

  #### Parameters

  - ##### doc: any

  - ##### fields: any

  #### Returns any

### _modify

- _modify(document: any, keyparts: any, value: any, key: any, level?: number): any

- - Defined in collection/Collection.ts:1116

  #### Parameters

  - ##### document: any

  - ##### keyparts: any

  - ##### value: any

  - ##### key: any

  - ##### Default value level: number = 0

  #### Returns any

### _testClause

- _testClause(clause: any, val: any): any

- - Defined in selector/SelectorMatcher.ts:368

  #### Parameters

  - ##### clause: any

  - ##### val: any

  #### Returns any

### _testLogicalClause

- _testLogicalClause(clause: any, doc: any, key: any): any

- - Defined in selector/SelectorMatcher.ts:467

  #### Parameters

  - ##### clause: any

  - ##### doc: any

  - ##### key: any

  #### Returns any

### _testObjectClause

- _testObjectClause(clause: any, doc: any, key: any): any

- - Defined in selector/SelectorMatcher.ts:442

  #### Parameters

  - ##### clause: any

  - ##### doc: any

  - ##### key: any

  #### Returns any

### _testOperatorClause

- _testOperatorClause(clause: any, value: any): boolean

- - Defined in selector/SelectorMatcher.ts:498

  #### Parameters

  - ##### clause: any

  - ##### value: any

  #### Returns boolean

### _testOperatorConstraint

- _testOperatorConstraint(key: any, operatorValue: any, clauseValue: any, docVal: any, clause: any): any

- - Defined in selector/SelectorMatcher.ts:510

  #### Parameters

  - ##### key: any

  - ##### operatorValue: any

  - ##### clauseValue: any

  - ##### docVal: any

  - ##### clause: any

  #### Returns any

### do_complex_group

- do_complex_group(): void

- - Defined in aggregation/Aggregation.ts:158

  #### Returns void

### do_group

- do_group(documents: any, group_stage: any): Array<Object>

- - Defined in aggregation/Aggregation.ts:172

  #### Parameters

  - ##### documents: any

  - ##### group_stage: any

  #### Returns Array<Object>

### do_match

- do_match(documents: any, match_stage: any): any

- - Defined in aggregation/Aggregation.ts:166

  #### Parameters

  - ##### documents: any

  - ##### match_stage: any

  #### Returns any

### do_project

- do_project(documents: any, project_stage: any): any

- - Defined in aggregation/Aggregation.ts:194

  #### Parameters

  - ##### documents: any

  - ##### project_stage: any

  #### Returns any

### do_single_group

- do_single_group(group_id: any, group_stage: any, documents: any): Array<Object>

- - Defined in aggregation/Aggregation.ts:97

  #### Parameters

  - ##### group_id: any

  - ##### group_stage: any

  - ##### documents: any

  #### Returns Array<Object>

### do_sort

- do_sort(documents: any, sort_stage: any): any

- - Defined in aggregation/Aggregation.ts:162

  #### Parameters

  - ##### documents: any

  - ##### sort_stage: any

  #### Returns any

### getObjectSize

- getObjectSize(obj: any): number

- - Defined in collection/Collection.ts:21

  Gets the size of an object.

  #### Parameters

  - ##### obj: any

    The object

  #### Returns number

  The size of the object

### Private hasSorting

- hasSorting(cursor: any): boolean

- - Defined in collection/Cursor.ts:679

  Checks if a cursor has a sorting defined

  #### Parameters

  - ##### cursor: any

    The cursor

  #### Returns boolean

  Whether the cursor has sorting or not

### isValidHexRegExp

- isValidHexRegExp(str: any, len?: number): boolean

- - Defined in document/ObjectId.ts:19

  #### Parameters

  - ##### str: any

  - ##### Default value len: number = 24

  #### Returns boolean

## Object literals

### BsonTypes

BsonTypes: object

- Defined in selector/SelectorMatcher.ts:657

### _types

_types: Array<object | object> = [{ alias: "minKey", number: -1, order: 1, isType: null },{ alias: "null", number: 10, order: 2, isType: null },{ alias: "int", number: 16, order: 3, isType: _.isInteger },{ alias: "long", number: 18, order: 3, isType: _.isNumber },{ alias: "double", number: 1, order: 3, isType: _.isNumber },{ alias: "number", number: null, order: 3, isType: _.isNumber },{ alias: "string", number: 2, order: 4, isType: _.isString },{ alias: "symbol", number: 14, order: 4, isType: _.isSymbol },{ alias: "object", number: 3, order: 5, isType: _.isPlainObject },{ alias: "array", number: 4, order: 6, isType: _.isArray },{ alias: "binData", number: 5, order: 7, isType: null },{ alias: "objectId", number: 7, order: 8, isTypefnc: null },{ alias: "bool", number: 8, order: 9, isType: _.isBoolean },{ alias: "date", number: 9, order: 10, isTypefnc: _.isDate }, // format{ alias: "timestamp", number: 17, order: 11, isType: _.isDate }, // format{ alias: "regex", number: 11, order: 12, isType: _.isRegExp },{ alias: "maxKey", number: 127, order: 13, isType: null }// undefined 6// dbPointer// javascript// javascriptWithScope// function]

- Defined in selector/SelectorMatcher.ts:658

### getByAlias

- getByAlias(alias: any): any

- - Defined in selector/SelectorMatcher.ts:684

  #### Parameters

  - ##### alias: any

  #### Returns any

### getByValue

- getByValue(val: any): any

- - Defined in selector/SelectorMatcher.ts:689

  #### Parameters

  - ##### val: any

  #### Returns any

### _modifiers

_modifiers: object

- Defined in collection/Collection.ts:1172

ignore

### $addToSet

- $addToSet(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1231

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $bit

- $bit(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1363

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $inc

- $inc(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1173

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $pop

- $pop(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1261

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $pull

- $pull(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1277

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $pullAll

- $pullAll(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1319

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $push

- $push(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1205

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $pushAll

- $pushAll(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1217

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $rename

- $rename(target: any, field: any, value: any): void

- - Defined in collection/Collection.ts:1349

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### value: any

  #### Returns void

### $set

- $set(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1189

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### $unset

- $unset(target: any, field: any, arg: any): void

- - Defined in collection/Collection.ts:1193

  #### Parameters

  - ##### target: any

  - ##### field: any

  - ##### arg: any

  #### Returns void

### group_operators

group_operators: object

- Defined in aggregation/Aggregation.ts:32

### $avg

- $avg(documents: any, new_id: any, new_field: any, value: any, isCount: any): object

- - Defined in aggregation/Aggregation.ts:61

  #### Parameters

  - ##### documents: any

  - ##### new_id: any

  - ##### new_field: any

  - ##### value: any

  - ##### isCount: any

  #### Returns object

### $sum

- $sum(documents: any, new_id: any, new_field: any, value: any, isCount: any): object

- - Defined in aggregation/Aggregation.ts:33

  #### Parameters

  - ##### documents: any

  - ##### new_id: any

  - ##### new_field: any

  - ##### value: any

  - ##### isCount: any

  #### Returns object

### stages

stages: object

- Defined in aggregation/Aggregation.ts:16

### $geoNear

$geoNear: boolean = false

- Defined in aggregation/Aggregation.ts:26

### $group

$group: boolean = true

- Defined in aggregation/Aggregation.ts:23

### $indexStats

$indexStats: boolean = false

- Defined in aggregation/Aggregation.ts:29

### $limit

$limit: boolean = false

- Defined in aggregation/Aggregation.ts:20

### $lookup

$lookup: boolean = false

- Defined in aggregation/Aggregation.ts:27

### $match

$match: boolean = true

- Defined in aggregation/Aggregation.ts:18

### $out

$out: boolean = false

- Defined in aggregation/Aggregation.ts:28

### $project

$project: boolean = true

- Defined in aggregation/Aggregation.ts:17

### $redact

$redact: boolean = false

- Defined in aggregation/Aggregation.ts:19

### $sample

$sample: boolean = false

- Defined in aggregation/Aggregation.ts:24

### $skip

$skip: boolean = false

- Defined in aggregation/Aggregation.ts:21

### $sort

$sort: boolean = true

- Defined in aggregation/Aggregation.ts:25

### $unwind

$unwind: boolean = false

- Defined in aggregation/Aggregation.ts:22

Generated using TypeDoc