Closed WynnLin closed 6 years ago
app.mongo.insertOne('test', { doc: { name: '123123' } })
app.mongo.find('test', { query: { name: 'test' } })
app.mongo.insertOne('test', { doc: { name: '123123' } })
app.mongo.find('test', { query: { name: 'test' } })
sorry for my first use, so doc or query are keywords?
Here is my config
exports.mongo = { client: { host: '127.0.0.1', port: '27017', name: 'test', user: 'root', password: 'root', options: {} } };
and I use it likeapp.mongo.insertOne('name', '123123');
for my mongoDB I have a database = test in the test database i have a collection which named test also
the error is show when i call
app.mongo.insertOne('name', '123123');
2018-09-18 15:15:24,693 ERROR 44536 nodejs.TypeError: Cannot read property '_id' of undefined
Is that clear for my issue