# Class: MongoService

## vertx-mongo-js/mongo_service~ MongoService

#### new MongoService()

Source:
  - vertx-mongo-js/mongo_service.js, line 38

### Methods

#### bulkWrite(collection, operations, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`operations` | Array.<Object> |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 330

##### Returns:

Type
  MongoService

#### bulkWriteWithOptions(collection, operations, bulkWriteOptions, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`operations` | Array.<Object> |
`bulkWriteOptions` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 353

##### Returns:

Type
  MongoService

#### close()

Source:
  - vertx-mongo-js/mongo_service.js, line 1046

#### count(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 629

##### Returns:

Type
  MongoService

#### createCollection(collectionName, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collectionName` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 830

##### Returns:

Type
  MongoService

#### createIndex(collection, key, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`key` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 893

##### Returns:

Type
  MongoService

#### createIndexWithOptions(collection, key, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`key` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 916

##### Returns:

Type
  MongoService

#### distinct(collection, fieldName, resultClassname, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`fieldName` | string |
`resultClassname` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 1004

##### Returns:

Type
  MongoService

#### distinctBatch(collection, fieldName, resultClassname, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`fieldName` | string |
`resultClassname` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 1027

##### Returns:

Type
  MongoService

#### dropCollection(collection, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 871

##### Returns:

Type
  MongoService

#### dropIndex(collection, indexName, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`indexName` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 959

##### Returns:

Type
  MongoService

#### find(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 375

##### Returns:

Type
  MongoService

#### findBatch(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 397

##### Returns:

Type
  MongoService

#### findBatchWithOptions(collection, query, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 443

##### Returns:

Type
  MongoService

#### findOne(collection, query, fields, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`fields` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 466

##### Returns:

Type
  MongoService

#### findOneAndDelete(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 584

##### Returns:

Type
  MongoService

#### findOneAndDeleteWithOptions(collection, query, findOptions, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`findOptions` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 607

##### Returns:

Type
  MongoService

#### findOneAndReplace(collection, query, replace, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`replace` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 537

##### Returns:

Type
  MongoService

#### findOneAndReplaceWithOptions(collection, query, update, findOptions, updateOptions, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`findOptions` | Object |
`updateOptions` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 562

##### Returns:

Type
  MongoService

#### findOneAndUpdate(collection, query, update, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 489

##### Returns:

Type
  MongoService

#### findOneAndUpdateWithOptions(collection, query, update, findOptions, updateOptions, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`findOptions` | Object |
`updateOptions` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 514

##### Returns:

Type
  MongoService

#### findWithOptions(collection, query, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 420

##### Returns:

Type
  MongoService

#### getCollections(resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 850

##### Returns:

Type
  MongoService

#### insert(collection, document, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`document` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 97

##### Returns:

Type
  MongoService

#### insertWithOptions(collection, document, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`document` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 120

##### Returns:

Type
  MongoService

#### listIndexes(collection, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 937

##### Returns:

Type
  MongoService

#### remove(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 651

##### Returns:

Type
  MongoService

#### removeDocument(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 763

##### Returns:

Type
  MongoService

#### removeDocuments(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 673

##### Returns:

Type
  MongoService

#### removeDocumentsWithOptions(collection, query, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 719

##### Returns:

Type
  MongoService

#### removeDocumentWithOptions(collection, query, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 809

##### Returns:

Type
  MongoService

#### removeOne(collection, query, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 741

##### Returns:

Type
  MongoService

#### removeOneWithOptions(collection, query, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 786

##### Returns:

Type
  MongoService

#### removeWithOptions(collection, query, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 696

##### Returns:

Type
  MongoService

#### replace(collection, query, replace, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`replace` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 237

##### Returns:

Type
  MongoService

#### replaceDocuments(collection, query, replace, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`replace` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 260

##### Returns:

Type
  MongoService

#### replaceDocumentsWithOptions(collection, query, replace, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`replace` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 308

##### Returns:

Type
  MongoService

#### replaceWithOptions(collection, query, replace, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`replace` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 284

##### Returns:

Type
  MongoService

#### runCommand(commandName, command, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandName` | string |
`command` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 981

##### Returns:

Type
  MongoService

#### save(collection, document, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`document` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 52

##### Returns:

Type
  MongoService

#### saveWithOptions(collection, document, writeOption, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`document` | Object |
`writeOption` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 75

##### Returns:

Type
  MongoService

#### update(collection, query, update, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 143

##### Returns:

Type
  MongoService

#### updateCollection(collection, query, update, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 166

##### Returns:

Type
  MongoService

#### updateCollectionWithOptions(collection, query, update, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 214

##### Returns:

Type
  MongoService

#### updateWithOptions(collection, query, update, options, resultHandler) → {MongoService}

##### Parameters:

Name | Type | Description
--- | --- | ---
`collection` | string |
`query` | Object |
`update` | Object |
`options` | Object |
`resultHandler` | function |

Source:
  - vertx-mongo-js/mongo_service.js, line 190

##### Returns:

Type
  MongoService