senecajs / seneca-mongo-store

Node.js Seneca data storage plugin for MongoDB
MIT License
35 stars 43 forks source link

Fix Quick Example #63

Closed marian2js closed 3 years ago

marian2js commented 7 years ago

The Quick Example in README.md was not working property.

Run of the original quick example:

$ node app.js 
{"kind":"notice","notice":"hello seneca 8wmccxmk7cmf/1495297912507/31942/3.3.0/-","level":"info","when":1495297912778}
apple.id = jd63w4

The code works without errors, but nothing is stored in mongo. Also the apple id is not a mongo ObjectID.

After including entity before mongo-store:

$ node app.js 
{"kind":"notice","notice":"hello seneca vezorrlgwebm/1495297952770/31943/3.3.0/-","level":"info","when":1495297952983}
apple.id = 59206fa0557c837cc74817b7

The apple is stored in the collection fruit and it contains a mongo ObjectID.

Environment: node: 7.10.0. mongo: 3.2.0. seneca: 3.3.0 seneca-entity: 2.0.0 seneca-mongo-store: 1.1.0

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 86.944% when pulling abb4e9639fe89378e1b22e5adede58e2b3996938 on marian2js:master into 187f342f27e89301f63a074d5dc7d50885313a71 on senecajs:master.