0.8.2 • Published 5 years ago

node-dao v0.8.2

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

node-dao

Node-Dao - Simple MongoDb-like interface to MySql, PostgreSql, SqlLite and Mongo databases

look like this:

var rsa = await daoConnection.find({}).limit(2).sort({ name: 1 }).toArray();

find method samples:

find({value: {$gte: 25}})

find({value: {$ne: 4}})

find({age: {$gt: 20, $lt:10}})

find({age: {$gt: 20, $lt:10}})

find({age: {$gt: 20}, name: {$eq: “jenny”}});

so, dao request

find({name: {$eq: “john”}}).limit(1).sort({time: -1}).limit(1).toArray();

will be translated for MySQL like that

SELECT * FROM messages WHERE name = “john” ORDER BY name DESC LIMIT 1 OFFSET 1;

If you call count() instread toArray() then the request will be generated as:

SELECT count(*) FROM messages WHERE name = “john” LIMIT 1 OFFSET 1;
0.8.2

5 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.6

6 years ago

0.7.5

6 years ago

0.7.4

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.1.1

6 years ago