Questions tagged [co-monk]
4 questions
5
votes
3 answers
Mongodb not returning specific fields
I am trying to return only one field sessions from a document.
I'm using the current query (it returns the entire document):
yield users.findOne({
'_id': id // var id holds object id ObjectId("560ae1dc53cb3222679430f1")
}, {
'_id': 0, //…

basickarl
- 37,187
- 64
- 214
- 335
1
vote
0 answers
Error while running js file via node
I was trying to run my koa app.js file but I could not get it to work.
Here's my app.js
var koa = require('koa'),
monk = require('monk'),
wrap = require('co-monk');
var db = monk("mongodb url here"),
collection = db.get('mycollection'),
transactions…

Markinator
- 31
- 2
0
votes
1 answer
mongodb aggregation (co-monk) undefined function
Following code does not seem to work, I receive undefined function. Using co-monk which is based on mongoskin which is based on the mongodb native node module.
Document:
{
"_id" : ObjectId("560c24b853b558856ef193a4"),
"name" : "ирина",
…

basickarl
- 37,187
- 64
- 214
- 335
0
votes
0 answers
Mongodb + koja + co-monk returning wrong value?
I am using: koajs, co-monk (mongodb wrapper)
I have the following insert operation:
res = yield sessions.insert({
value: 1
});
console.log(res);
It spits out the object in the console:
{ "_id" : ObjectId("560ac28ff13858145218f259"), "value" : 1…

basickarl
- 37,187
- 64
- 214
- 335