PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 28th of December, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:04:28] <hulkk> cheeser u can append some field:value in object { } without using arrays ? depends what ur answer is will give me a clear mind about how things work :)
[00:07:26] <cheeser> you can $set "field.value"
[00:07:32] <cheeser> like i said earlier
[00:15:09] <hulkk> cheeser look http://oi60.tinypic.com/15gteo2.jpg can i append "field" : "value" where you see "rre" : "eee", "dasd" : "dasd"
[00:15:56] <hulkk> cheeser or i can do this only with one update query specifing again the same field : values + the extra i want to add
[00:18:38] <hulkk> cheeser you understand me ?
[00:21:33] <cheeser> $push will add whatever value you give to it to the array you specify
[00:22:01] <cheeser> in this case structure is an array whose first element is a document. you just pushed two new strings in to subsequent elements
[00:22:31] <hulkk> cheeser and does exists something that $push works on objects { "so i append data here"} not arrays
[00:22:59] <cheeser> http://docs.mongodb.org/manual/reference/operator/update/push/
[00:23:23] <cheeser> you should spend time reading the docs on these operators. they clearly explain the answer to these questions you've been asking.
[00:53:21] <zamnuts> node.js driver: how to specify a 2 hour timeout on a cursor? I don't want to use the `noTimeout` wire protocol flag which i'm assuming is simply specifying `timeout: false` in `collection.find`'s options...
[00:54:37] <zamnuts> is it `maxTimeMS`? and what does typical usage look like for `timeout` and/or `maxTimeMS`?
[00:58:29] <zamnuts> alternatively if I must specify `noTimeout` as `true` then while keeping it `false` how can i signal a "keep-alive" to the cursor?
[01:00:45] <zamnuts> well http://docs.mongodb.org/manual/reference/method/cursor.maxTimeMS/#cursor.maxTimeMS answered my question regarding `maxTimeMS`: "maxTimeMS() is not related to the NoCursorTimeout query flag. maxTimeMS() relates to processing time, while NoCursorTimeout relates to idle time."
[01:01:33] <zamnuts> it appears at this point it is either all or nothing. if my application crashes and i have an open cursor with timeout disabled - what happens? does the cursor stay open indefinitly?
[01:01:56] <zamnuts> s/indefinitly/indefinitely/
[06:00:21] <hagb4rd> hi
[06:03:10] <joannac> hi
[06:03:50] <hagb4rd> i'm trying to use the $text query operator as described here http://docs.mongodb.org/manual/reference/operator/query/text/.. when i try to .ensureIndex({ text: "text" }), a textidex on the field text i get the following error: "[Error] Cannot use a writeConcern without a provided callback"
[06:03:59] <hagb4rd> can u help?
[06:04:24] <joannac> that looks like a nodejs kind of error?
[06:04:50] <hagb4rd> really?
[06:05:01] <hagb4rd> i mean yea.. that's reasonable
[06:05:24] <specialsauce> just add a callback
[06:05:24] <joannac> looking at http://stackoverflow.com/questions/19468975/mongodb-error-cannot-use-a-writeconcern-without-a-provided-callback-on-remove
[06:05:31] <joannac> it looks like y... what specialsauce said
[06:05:37] <specialsauce> ..."text"}, function(){});
[06:05:53] <specialsauce> handle however is appropriate
[06:06:45] <specialsauce> an err argument will be passed in so function(err){...}); if you wish
[06:06:46] <hagb4rd> weee.. specialsauce..it works! greeat
[06:06:51] <hagb4rd> thank you
[06:07:31] <hagb4rd> i didn't know the api for node.js is different at all
[06:08:37] <hagb4rd> do i need to ensureIndex() just once? or on every connection?
[06:09:38] <hagb4rd> *once for a field in a connection?
[06:09:51] <hagb4rd> arg connection
[07:43:04] <hagb4rd> hey..got one more question: would it make sense to keep the field names short in order to save space? or is this handled by mongodn internally somehow?
[14:17:14] <munumnu> i want to query a collection containing docs with >27 fields. The find query is generated dynamically (combination of all fields possible). What would be a good way to ensureIndex() everything? Should I simply call it with every field possible?
[17:20:32] <specialsauce> is it possible to check if a document can be inserted into a collection before actually committing to a write?
[17:21:00] <specialsauce> assuming there are various indexes etc on the collection that could potentially stop a write
[17:23:42] <cheeser> you'd have a race condition if you tried.
[17:28:24] <specialsauce> it would be acceptable though, I am trying to insert documents into a collection that should at any time only contain at most n of a particular type... currently im doing this via recursive bulk inserts of size 'remaining window' of which some or many may fail if they conflict with a unique index for example
[17:29:09] <specialsauce> the worst case being where you have a window of say 1 available space left and try to insert say 1000 all of which are errors due to an index
[17:29:19] <specialsauce> ie you get a 1000 level recurse
[17:29:47] <specialsauce> if I could remove the ones that will fail on the index prior, I can reduce the call stack greatly
[17:30:47] <specialsauce> alternatively is there some way to insert in a synchronous way until the window is filled? or does that defeat the purpose of mongo
[19:00:49] <Keksike> im using mongoose, how can I get the n:th entry from my mongodb?
[19:00:58] <Keksike> I sorted them, now I want to get lets say the fifth entry
[19:25:44] <asturel_> .skip(5).limit(1)?
[19:25:53] <asturel_> 5->4
[19:33:05] <Keksike> asturel_: ok, how do I use that with findOne?
[19:34:55] <asturel_> how would u select the fifth entry from one item set?
[19:35:21] <Keksike> ok umm, find then :)
[19:36:04] <asturel_> may im complety wrong and there's a better solution tho
[19:36:57] <Keksike> so basically I just want to find the fifth newest entry in my db
[19:37:16] <Keksike> I probably dont have to use find
[19:37:22] <Keksike> or actually nth newest entry :)
[19:37:41] <Keksike> im using sort: {'time' : -1} in my find
[19:38:37] <asturel_> db.foo.find().sort({_id:- 1}).skip(4).limit(1)
[19:40:45] <Keksike> ummm
[19:41:25] <Keksike> should I be able to return that?
[19:42:09] <Keksike> return Quote.find().sort({quoteId: -1}).skip(req.params.id).limit(1); not working
[19:43:49] <Keksike> even with apostrophies around quoteId :)
[19:46:14] <Keksike> res.send:ing that doesnt work either
[19:49:36] <Keksike> asturel_: any ideas?
[19:51:51] <asturel_> nodejs?:D
[19:52:21] <Keksike> yeah
[19:54:36] <asturel_> and does it works outside nodejs?:D
[19:54:49] <Keksike> no idea how to test
[19:55:47] <asturel_> type mongo on your shell?
[19:55:56] <asturel_> or connect remotely
[19:56:30] <asturel_> btw does nodejs's mongo support synced calls?
[19:57:08] <asturel_> i used this way collection.find(filter || {}).sort({ _id: -1}).limit(50).toArray(function(err, docs) {
[20:01:04] <Keksike> doesnt seem to be working
[20:01:46] <Keksike> quotes.find(filter || {}).sort({ _id: -1}).limit(1).toArray(function(err, docs){
[20:01:49] <Keksike> if(docs != null){
[20:01:52] <Keksike> res.send(quotelol);
[20:01:54] <Keksike> }
[20:01:57] <Keksike> });
[20:02:55] <Keksike> quotelol -> docs doesnt help
[20:04:17] <asturel_> console.log(err) ?
[20:04:45] <asturel_> res.send supports arrays btw?
[20:04:58] <Keksike> I dont think thats the problem anyway
[20:05:13] <Keksike> my db name is quotesdb and collection name is quotes, im using a schema called Quote though
[20:05:57] <Keksike> ReferenceError: filter is not defined
[20:08:08] <asturel_> remvoe the filter ||part :D
[20:08:46] <Keksike> didnt work
[20:09:53] <Keksike> damn
[21:09:26] <Nitax> If I use Mongoose and call myModel.save(myCallback) without first opening a MongoDB connection, shouldn't Mongoose throw some kind of error?
[21:09:46] <Nitax> I am just seeing the call timeout after some period of time