mongodb-data-service
MongoDB Data Service
Last updated 4 days ago by alena.khineika .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mongodb-data-service 
SYNC missed versions from official npm registry.

mongodb-data-service

MongoDB Data Service: an API on top of (currently) the MongoDB Node Driver and (some day) mongodb-scope-client.

Installation

npm install --save mongodb-data-service

Usage

Instantiating the service.

const Connection = require('mongodb-connection-model');
const DataService = require('mongodb-data-service');

var service = new DataService(new Connection({
  hostname: '127.0.0.1',
  port: 27018,
  ns: 'data-service'
}));

Connecting to the server.

Once the service is ready, it will also emit a readable event.

service.connect((err) => assert.equal(null, err)})
  .on('readable', () => console.log('Connected!'));

API

// Get information for a collection.
service.collection('database.collection', {}, (error, result) => {
  assert.equal(null, error);
});

// Get a document count.
service.count('database.collection', { a: 1 }, {}, (error, count) => {
  assert.equal(null, error);
});

// Get information for a database.
service.database('database', {}, (error, result) => {
  assert.equal(null, error);
});

// Find documents in a collection.
service.find('database.collection', { a: 1 }, {}, (error, documents) => {
  assert.equal(null, error);
});

// Get a result for a RESTful endpoint.
service.get('/collection/database.test', {}, (error, result) => {
  assert.equal(null, error);
});

// Get instance details.
service.instance({}, (error, result) => {
  assert.equal(null, error);
});

// Get a sample stream of documents from a collection.
service.sample('database.collection', {});

Instance Details

collections

[
  {
    _id: 'admin.system.version',
    name: 'system.version',
    database: 'admin',
    readonly: false,
    collation: null,
    type: 'collection',
    view_on: undefined,
    pipeline: undefined
  },
  {
    _id: 'config.system.sessions',
    name: 'system.sessions',
    database: 'config',
    readonly: false,
    collation: null,
    type: 'collection',
    view_on: undefined,
    pipeline: undefined
  },
  {
    _id: 'data-service.test',
    name: 'test',
    database: 'data-service',
    readonly: false,
    collation: null,
    type: 'collection',
    view_on: undefined,
    pipeline: undefined
  },
  {
    _id: 'data-service.system.views',
    name: 'system.views',
    database: 'data-service',
    readonly: false,
    collation: null,
    type: 'collection',
    view_on: undefined,
    pipeline: undefined
  },
  {
    _id: 'data-service.myView',
    name: 'myView',
    database: 'data-service',
    readonly: true,
    collation: null,
    type: 'view',
    view_on: 'test',
    pipeline: [{ $project: { a: 0 } }]
  },
  {
    _id: 'local.startup_log',
    name: 'startup_log',
    database: 'local',
    readonly: false,
    collation: null,
    type: 'collection',
    view_on: undefined,
    pipeline: undefined
  }
]

License

Apache 2.0

Current Tags

  • 0.0.18                                ...           0.0-backports (3 years ago)
  • 15.4.5                                ...           latest (4 days ago)

187 Versions

  • 15.4.5                                ...           4 days ago
  • 15.4.4                                ...           12 days ago
  • 15.4.3                                ...           12 days ago
  • 15.4.2                                ...           14 days ago
  • 15.4.1                                ...           14 days ago
  • 15.4.0                                ...           a month ago
  • 15.3.2                                ...           a month ago
  • 15.3.1                                ...           2 months ago
  • 15.3.0                                ...           2 months ago
  • 15.2.1                                ...           2 months ago
  • 15.2.0                                ...           2 months ago
  • 15.1.7                                ...           3 months ago
  • 15.1.6                                ...           3 months ago
  • 15.1.5                                ...           3 months ago
  • 15.1.4                                ...           3 months ago
  • 15.1.3                                ...           3 months ago
  • 15.1.2                                ...           3 months ago
  • 15.1.1                                ...           3 months ago
  • 15.1.0                                ...           3 months ago
  • 15.0.3                                ...           3 months ago
  • 15.0.2                                ...           4 months ago
  • 15.0.1                                ...           4 months ago
  • 14.0.7                                ...           4 months ago
  • 14.0.6                                ...           4 months ago
  • 15.0.0                                ...           5 months ago
  • 14.0.5                                ...           6 months ago
  • 14.0.4                                ...           7 months ago
  • 14.0.3                                ...           7 months ago
  • 14.0.2                                ...           7 months ago
  • 14.0.1                                ...           7 months ago
  • 14.0.0                                ...           7 months ago
  • 13.0.1                                ...           8 months ago
  • 13.0.0                                ...           8 months ago
  • 12.5.2                                ...           8 months ago
  • 12.5.1                                ...           8 months ago
  • 12.5.0                                ...           8 months ago
  • 12.4.17                                ...           10 months ago
  • 12.4.16                                ...           a year ago
  • 12.4.15                                ...           a year ago
  • 12.4.14                                ...           a year ago
  • 12.4.13                                ...           a year ago
  • 12.4.12                                ...           a year ago
  • 12.4.11                                ...           a year ago
  • 12.4.10                                ...           a year ago
  • 12.4.9                                ...           a year ago
  • 12.4.8                                ...           a year ago
  • 12.4.7                                ...           a year ago
  • 12.4.6                                ...           a year ago
  • 12.4.5                                ...           a year ago
  • 12.4.4                                ...           a year ago
  • 12.4.3                                ...           a year ago
  • 12.4.2                                ...           a year ago
  • 12.4.1                                ...           a year ago
  • 12.4.0                                ...           a year ago
  • 12.3.1                                ...           a year ago
  • 12.3.0                                ...           a year ago
  • 12.2.2                                ...           a year ago
  • 12.2.1                                ...           a year ago
  • 12.2.0                                ...           a year ago
  • 12.1.4                                ...           a year ago
  • 12.1.3                                ...           a year ago
  • 12.1.2                                ...           a year ago
  • 12.1.1                                ...           a year ago
  • 12.1.0                                ...           a year ago
  • 12.0.0                                ...           2 years ago
  • 11.3.0                                ...           2 years ago
  • 11.2.0                                ...           2 years ago
  • 11.1.3                                ...           2 years ago
  • 11.1.2                                ...           2 years ago
  • 11.1.1                                ...           2 years ago
  • 11.1.0                                ...           2 years ago
  • 11.0.4                                ...           2 years ago
  • 11.0.3                                ...           2 years ago
  • 11.0.2                                ...           2 years ago
  • 11.0.1                                ...           2 years ago
  • 11.0.0                                ...           2 years ago
  • 10.1.0                                ...           2 years ago
  • 10.0.0                                ...           2 years ago
  • 9.0.2                                ...           2 years ago
  • 9.0.1                                ...           2 years ago
  • 9.0.0                                ...           2 years ago
  • 8.7.0                                ...           2 years ago
  • 8.6.0                                ...           2 years ago
  • 8.5.0                                ...           2 years ago
  • 8.4.0                                ...           2 years ago
  • 8.3.2                                ...           2 years ago
  • 8.3.1                                ...           2 years ago
  • 8.3.0                                ...           2 years ago
  • 8.2.0                                ...           2 years ago
  • 8.1.0                                ...           2 years ago
  • 8.0.2                                ...           2 years ago
  • 8.0.1                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.2.0                                ...           2 years ago
  • 7.1.0                                ...           2 years ago
  • 7.0.0                                ...           2 years ago
  • 6.1.0                                ...           2 years ago
  • 6.0.0                                ...           2 years ago
  • 5.1.0                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 5.0.0-beta.2                                ...           2 years ago
  • 5.0.0-beta.1                                ...           2 years ago
  • 4.0.2                                ...           3 years ago
  • 2.15.2                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 4.0.0-beta.2                                ...           3 years ago
  • 4.0.0-beta.1                                ...           3 years ago
  • 4.0.0-beta.0                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.15.1                                ...           3 years ago
  • 2.15.0                                ...           3 years ago
  • 2.14.2                                ...           3 years ago
  • 2.14.1                                ...           3 years ago
  • 2.14.0                                ...           3 years ago
  • 2.13.1                                ...           3 years ago
  • 2.13.0                                ...           3 years ago
  • 2.12.3                                ...           3 years ago
  • 2.12.2                                ...           3 years ago
  • 2.12.1                                ...           3 years ago
  • 2.12.0                                ...           3 years ago
  • 2.11.0                                ...           3 years ago
  • 2.10.0                                ...           3 years ago
  • 2.9.0                                ...           3 years ago
  • 2.8.0                                ...           3 years ago
  • 2.7.0                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.1                                ...           3 years ago
  • 2.5.0                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.7                                ...           3 years ago
  • 2.1.6                                ...           3 years ago
  • 2.1.5                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 2.0.0-alpha.0                                ...           3 years ago
  • 1.9.0                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 1.7.1                                ...           3 years ago
  • 1.7.0                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.5.0                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.0.18                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.17                                ...           4 years ago
  • 0.0.16                                ...           4 years ago
  • 0.0.15                                ...           4 years ago
  • 0.0.14                                ...           4 years ago
  • 0.0.13                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 16
Last Day 0
Last Week 16
Last Month 69
Dependencies (27)
Dev Dependencies (8)

Copyright 2014 - 2016 © taobao.org |