# Class: MongoService

## vertx-mongo-js/mongo_service~ MongoService

#### new MongoService()

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

### Methods

#### close()

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

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

##### Parameters:

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

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

##### Returns:

Type
  MongoService

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

##### Parameters:

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

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

##### 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 845

##### 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 868

##### 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 956

##### 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 979

##### Returns:

Type
  MongoService

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

##### Parameters:

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

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

##### 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 911

##### 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 327

##### 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 349

##### 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 395

##### 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 418

##### 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 536

##### 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 559

##### 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 489

##### 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 514

##### 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 441

##### 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 466

##### 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 372

##### Returns:

Type
  MongoService

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

##### Parameters:

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

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

##### 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 94

##### 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 117

##### Returns:

Type
  MongoService

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

##### Parameters:

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

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

##### 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 603

##### 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 715

##### 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 625

##### 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 671

##### 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 761

##### 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 693

##### 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 738

##### 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 648

##### 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 234

##### 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 257

##### 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 305

##### 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 281

##### 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 933

##### 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 49

##### 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 72

##### 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 140

##### 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 163

##### 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 211

##### 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 187

##### Returns:

Type
  MongoService