https://github.com/aleclarson/mongo
Adaptor for using MongoDB and Minimongo over DDP
https://github.com/aleclarson/mongo
Last synced: 2 months ago
JSON representation
Adaptor for using MongoDB and Minimongo over DDP
- Host: GitHub
- URL: https://github.com/aleclarson/mongo
- Owner: aleclarson
- License: mit
- Created: 2015-08-01T19:53:19.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T16:51:10.000Z (over 7 years ago)
- Last Synced: 2025-03-11T12:33:32.513Z (over 1 year ago)
- Language: JavaScript
- Size: 80.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongo v1.1.1 [](http://github.com/badges/stability-badges)
This package is stripped from [meteor/mongo](https://atmospherejs.com/meteor/mongo) and made compatible with [React Native](https://github.com/facebook/react-native).
**Note:** This package is only for client-side usage.
## usage
```js
var Mongo = require('mongo');
var Meteor = require('meteor-client');
var collection = new Mongo.Collection('users', {
connection: Meteor.connection, // The DDP connection to use (defaults to Meteor.connection)
autoPublish: false, // Used in place of "meteor/autopublish"
insecure: false, // Used in place of "meteor/insecure"
idGeneration: 'MONGO', // The method of generating the `_id` fields of new documents in this collection (defaults to 'STRING')
transform: function () { /* ... */ }, // Function that is passed the results of `fetch()` or `findOne()`
});
```
## install
```sh
npm install aleclarson/mongo#1.1.1
```