NeDB find Date filters

node v12.22.12
version: master
endpointsharetweet
const Datastore = require('nedb') const db = new Datastore(); var doc = { hello: 'world' , n: 5 , today: new Date() , nedbIsAwesome: true , notthere: null , notToBeSaved: undefined // Will not be saved , fruits: [ 'apple', 'orange', 'pear' ] , infos: { name: 'nedb' } , createdAt: new Date().toISOString() }; db.insert(doc, afterInsert); function afterInsert(err, docs) { db.find({ createdAt: { $gte:"2019-09-01T00:00:00.000Z" } }, afterFind); } function afterFind (err, docs) { console.log(docs) }
Loading…

no comments

    sign in to comment