0.6.0 • Published 4 years ago

waterline-mongoose-adapter v0.6.0

Weekly downloads
314
License
MIT
Repository
github
Last release
4 years ago

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

  • findOne
  • find
  • count
  • create
  • update
  • destroy
  • native

query

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

License

waterline-mongoose-adapter is MIT licensed.

0.6.0

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago