waterline-mongoose-adapter

0.6.0 • Public • Published

waterline-mongoose-adapter

This is an mongoose adapter for waterline to ideally help a project migrate off using waterline onto mongoose. This reason this library was originally writen was the company I worked was looking migrate away from waterline but didn't want to entirely rewrite all the ORM in one go. With this library it will allow our team to slowly rewrite parts of the ORM at a time, while the rest of the application is still using the adapter.

How to Install

$ npm i waterline-mongoose-adapter mongoose --save-dev

How to use it

const mongoose = require('mongoose')
const { WaterlineMongooseAdapter } = require('waterline-mongoose-adapter');

const schema = new mongoose.Schema(
  {
    name: {
      type: String,
      required: true,
      unique: true
    }
  },
  { collection: 'User' }
);

const MongooseUser = mongoose.model('User', schema);
const User = WaterlineMongooseAdapter({ Model: MongooseUser });


const result = await User.find({ name: 'bob'});

What is currently supported

Methods

  • [x] findOne
  • [x] find
  • [x] count
  • [x] create
  • [x] update
  • [x] destroy
  • [x] native

query

  • [x] limit
  • [x] skip
  • [x] sort
  • [x] where
  • [x] or
  • [x] '<'
  • [x] '<='
  • [x] '>'
  • [x] '>='
  • [x] '!='
  • [ ] 'nin'
  • [ ] 'in'
  • [ ] 'contains'
  • [ ] 'startsWith'
  • [ ] 'endsWith'

License

waterline-mongoose-adapter is MIT licensed.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.6.0553latest

Version History

VersionDownloads (Last 7 Days)Published
0.6.0553
0.5.32
0.5.22
0.5.02
0.4.52
0.4.42
0.4.32
0.4.22
0.4.12
0.4.02
0.3.02
0.2.122
0.2.112
0.2.103
0.2.92
0.2.82
0.2.62
0.2.52
0.2.42
0.2.32
0.2.22
0.2.12
0.2.02
0.1.03

Package Sidebar

Install

npm i waterline-mongoose-adapter

Weekly Downloads

3

Version

0.6.0

License

MIT

Unpacked Size

37.1 kB

Total Files

19

Last publish

Collaborators

  • acac9999