0.5.0 • Published 8 years ago

mongo-to-knex v0.5.0

Weekly downloads
56
License
-
Repository
github
Last release
8 years ago

mongo to knex

Applies mongo standard query to knex query builder.

Available operators

Checkout the available operators in the tests.

Installation

Install via npm:

$ npm install mongo-to-knex

Usage

var mongoToKnex = require('mongo-to-knex');

// knex main object
var knex = require('knex')({ /* knex config */ });

// knex query builder object
var knexQuery = knex('your-table-name');

// your query on mongo standard
var mongoQuery = { age: { $lt: 10 } };

// applies mongo query to knex builder
mongoToKnex(mongoQuery, knexQuery);

// continue using the knex query normally
return knexQuery.
  .limit(100)
  .orderBy('name', 'desc');

Contributing

It is required to use editorconfig and please write and run specs before pushing any changes:

npm test

License

Copyright (c) 2015 Max Claus Nunes. This software is licensed under the MIT License.

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago