Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mongoosejs/mongoose-v2-compat
Adds a compatibility layer to Mongoose v3 to regain most of the API sugar from Mongoose v2
https://github.com/mongoosejs/mongoose-v2-compat
Last synced: 19 days ago
JSON representation
Adds a compatibility layer to Mongoose v3 to regain most of the API sugar from Mongoose v2
- Host: GitHub
- URL: https://github.com/mongoosejs/mongoose-v2-compat
- Owner: mongoosejs
- License: mit
- Created: 2012-05-30T22:17:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-06-20T19:25:54.000Z (over 12 years ago)
- Last Synced: 2024-12-10T14:51:27.503Z (about 1 month ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
#mongoose-v2-compat
====================Adds a compatibility layer to Mongoose v3 to regain most of the API sugar from Mongoose v2.
## install
```
npm install mongoose-v2-compat
```Example:
```js
require('mongoose-v2-compat');
var mongoose = require('mongoose');
mongoose.compat = true;// now we can use all the old methods
mongoose.connectSet('...');Thing.where('tags').$in(array).asc('name').run(callback);
```## Provided methods
- Query#$or
- Query#$nor
- Query#$gt
- Query#$gte
- Query#$lt
- Query#$lte
- Query#$ne
- Query#$in
- Query#$nin
- Query#$all
- Query#$regex
- Query#$size
- Query#$maxDistance
- Query#$mod
- Query#$near
- Query#$exists
- Query#$elemMatch
- Query#$within
- Query#$box
- Query#$center
- Query#$centerSphere
- Query#$slice
- Query#run
- Query#notEqualTo
- Query#wherein
- Query#fields
- Query#asc
- Query#desc
- mongoose.createSetConnection
- mongoose.connectSet
- document#commit
- MongooseArray#$push
- MongooseArray#$pushAll
- MongooseArray#$pull
- MongooseArray#$pullAll
- MongooseArray#$unshift
- MongooseArray#$addToSet## tests
Run the tests with `make test`.
[LICENSE](https://github.com/aheckmann/mongoose-v2-compat/blob/master/LICENSE)