A wrapped MongoDB collection with record compression inlined.

Constructor

Static Properties

Instance Methods

aggregate (
[ options ] ,
) {

Compress and submit an aggregation pipeline to the database. Decompress and retrieve the results.

Arguments

count ( ) {

Compress a query, select and count matching records.

Arguments

distinct (
[ query ] ,
[ options ] ,
) {

Scan a collection or query selection, collecting all unique values and/or subdocuments.

Arguments

| String key

The path to scan.

optional
| Object query

Selects a subset of documents to scan for unique values.

optional
| JSON options
dropAllIndexes ( ) {

Remove all indexes from the database.

Arguments

dropIndex ( ) {

Remove an index from the database by name.

Arguments

ensureIndex (
[ options ] ,
) {

Compress an index specification and ensure that it exists on the database.

Arguments

find (
[ options ] ,
) {

Compress a query and pass it to the database, producing a cursor.

Arguments

optional
| Object projection

Projection specification document. Compressed before submission.

optional
| Object options

Pass native options to MongoDB. The sort and hint options will be compressed.

findAll (
[ options ] ,
) {

A convenience method to call find and then toArray on the resultant cursor. Optionally project or pass other options.

DANGER - like toArray, you can run the process out of memory if your query selects tons of documents. It is highly recommended that you use use the limit option to control the return batch.

Arguments

findAndModify (
[ options ] ,
) {

Compress and submit an update to the database and retrieve the affected record atomically.

Arguments

findAndRemove (
[ options ] ,
) {

Compress a query, select one document, remove it from the database and retrieve its contents.

Arguments

findOne (
[ fields ] ,
[ options ] ,
[ skip ] ,
[ limit ] ,
[ timeout ] ,
) {

Compress a query document and query the database for zero or one matching records. Optionally project the result record.

Note that contrary to the native driver documentation, in mingydb the second argument is always assumed to be a projection, never an options object.

Arguments

geoHaystackSearch (
x ,
y ,
[ options ] ,
) {

Search for documents located near a legacy coordinate pair using a Haystack index. Requires that this collection have exactly one geospatial index of geoHaystack type.

Arguments

geoNear (
[ geoJSON ] ,
[ x ] ,
[ y ] ,
[ options ] ,
) {

Search for documents located near a legacy coordinate pair or GeoJSON location document. Requires that this collection have exactly one geospatial index of either 2d or 2dsphere type.

Arguments

indexExists ( ) {

Determine whether one or more indexes exist on this collection.

Arguments

indexInformation (
[ options ] ,
) {

Acquire a document describing all indexes on this collection.

Arguments

initializeOrderedBulkOp (
[ options ] ,
) {

Initialize a new ordered bulk operation. Both documented callbacks in the driver are supported so you may pass one both at instantiation and execution. They will both execute.

Arguments

optional
| Object options
optional
callback ( ) {

Arguments

| Object results

The native driver may not fully support the results driver, presenting 0 and [] for all properties in some environments.

initializeUnorderedBulkOp (
[ options ] ,
) {

Initialize a new unordered bulk operation. Both documented callbacks in the driver are supported so you may pass one both at instantiation and execution. They will both execute.

Arguments

optional
| Object options
optional
callback ( ) {

Arguments

| Object results

The native driver may not fully support the results driver, presenting 0 and [] for all properties in some environments.

insert ( ) {

Compress and insert a record into the database. Unknown paths will be given new minification keys. Unlike native insertion, the callback is not optional. This is because the record compression stage may generate an Error.

Arguments

isCapped ( ) {

Determine whether this collection is capped.

Arguments

, | mingydb.IndexInfoCursor listIndexes ( ) {

Creates a cursor for exploring index information on this collection.

Arguments

Returns

options ( ) {
reIndex ( ) {

Rebuild all indexes on this collection.

Arguments

remove (
[ options ] ,
) {

Compress a query, submit it to the database and delete all matching records.

Arguments

rename (
[ options ] ,
) {

Rename this collection.

Arguments

save ( ) {

Compress and save a record into the database. If the saved record has an _id field, an upsert is performed. Otherwise a new document is inserted.

stats ( ) {

Obtain database stats information.

Arguments

update (
[ options ] ,
) {

Compress and submit an update to the database.

Arguments