PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 22nd of June, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:12:36] <dman777_alter> does mongodb make all of it's collections plural?
[03:06:02] <BadHorsie> dman777_alter: I think the one that did it (in my experience was Mongoose if you don't explicitly name your collection... Unless you mean something else.
[03:37:13] <dman777_alter> BadHorsie: that makes sense, thanks
[06:56:10] <elm> Is it possible to write to a secondary only?
[07:07:44] <elm> what is the default in mongodb: last write wins?
[07:07:56] <elm> how to specify the behaviour for conflicting writes?
[07:08:11] <elm> I can find it nowhere in the docs.
[07:28:50] <joannac> elm: um, no you can't write to a secondary only
[07:29:08] <joannac> elm: yes, if you have 2 writes coming in, last write wins
[07:29:16] <joannac> what do you mean by "conflicting writes"?
[07:37:27] <elm> one write which has seen state a replacing by b and another write which has seen state a replacing by c
[07:37:53] <elm> so a->b or a->c; what will be the result?
[07:38:40] <elm> usually a write carries the timestamp of the state it is based upon as well as a timestamp on when it was issued.
[07:39:08] <elm> there are multiple strategies to resolve such a conflicting write:
[07:39:19] <elm> * last write wins
[07:39:26] <elm> * merging of results
[07:39:35] <elm> and possibly others
[07:47:49] <joannac> if you are going to do something like db.foo.update({a:1}, {$set: {a: 2}}), I believe that should not be able to happen
[07:48:45] <joannac> if you are going to do something like mydocument = db.foo.find({a:1}); [fiddle with it], db.foo.save(mydocument), then you need to handle it yourself
[07:48:59] <elm> it can happen on a db.foo.update({_id:...}, {$set: {a: 2}}),
[07:49:05] <elm> how can I handle it myself?
[07:49:26] <joannac> i dunno, check the document hasn't changed in the meantime before you save it?
[07:49:27] <elm> there needs to be some handler or so
[07:49:59] <joannac> mark documents $set {inprogress: true}?
[07:50:35] <elm> but mongodb does not support transactions; so between checking whether it has changed and x it may change again
[07:51:26] <elm> inprogress: where is it documented?
[07:53:08] <joannac> here, go read this: http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/
[07:58:35] <elm> "It’s possible for applications to return intermediate data at intermediate points during the two-phase commit or rollback."
[07:58:42] <elm> is that like read uncommited?
[07:59:32] <joannac> yes
[08:02:18] <elm> by the way: what is the diffrence between update and save?
[08:05:16] <joannac> http://docs.mongodb.org/manual/reference/method/db.collection.save/#behavior
[08:05:26] <joannac> http://docs.mongodb.org/manual/reference/method/db.collection.update/#behavior
[08:22:39] <elm> might it be that there is no timestamp based update for mongodb?
[08:23:13] <elm> i.e. all writes are directed through the master and the last write wins there.
[08:23:16] <elm> correct?
[08:23:56] <elm> i.e. if I do a $set:{...} it will be applied by the master and then the same way by all clients
[08:24:23] <elm> and just the order in which it arrives at the master will decide which write wins.
[08:24:30] <elm> correct?
[08:27:00] <joannac> yes
[08:28:30] <elm> what if I wanted it to store multiple versions of a changed item?
[08:28:33] <elm> use $push?
[08:28:48] <joannac> sure
[08:29:00] <elm> does it allow duplicate entries i.e. ["0123","0123"] ?
[08:29:07] <joannac> yes
[08:29:15] <joannac> you can store what you like in an array
[08:31:49] <elm> do you know if $push does automatically eliminate duplicates?
[08:32:13] <elm> let me see ...
[08:33:40] <joannac> no
[08:33:45] <joannac> you want $addToSet
[08:35:05] <elm> can it only be applied to a list or may I also apply it to a scalar data item which is then converted to a list automatically?
[08:35:26] <elm> i.e. telnr: 123 -> telnr:[123,456]
[08:35:27] <joannac> you mean an array?
[08:35:30] <elm> yes
[08:35:37] <joannac> No, it must be an array
[08:36:02] <elm> o.k. then we need to be prepared for multiversioning in advance.
[08:36:30] <elm> joannac: many thanks; I believe you have answered all my questions!
[08:39:11] <joannac> np
[13:47:37] <lfmendes> Hello, is anybody having troubles logging in in the mms? My google authenticator is not working.
[16:38:57] <TonetJallo> hello
[16:39:54] <TonetJallo> anyone knows why mogodb logo is a leaf?
[16:40:13] <TonetJallo> cause me curious
[16:46:28] <Ravenheart> well a ravaging monkey wouldn't be very reasuring :)
[17:35:37] <fschuindt> Mongoid 3.1.6 is compatible with which version of Rails?
[18:10:57] <nexusIL> I'm looking for a way to make a mapreduce(query) which 'updates' and aggragate the keys and updates/removes on the projection of the query (and not the rest) on the same collection I was querying. The other option is to run MR on all the collection and I think It's inefficent.
[19:19:16] <ztroy> hi, any one can help me with the C driver ?
[19:20:09] <ztroy> it compile with mongoc.h and bson.h
[19:20:26] <ztroy> but when i want to read bson with bson_iterator
[19:20:36] <ztroy> i've the following error "unknown type name ‘bson_iterator’"
[19:21:02] <ztroy> (compiled with -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -lrt -lmongoc-1.0 -lbson-1.0)
[19:41:19] <zerofaith> Hey guys, is there anyway I can get mongodb to be relational (using mongoose/nodejs)
[19:42:08] <stephenmac7> Hello, I have an application which uses mongodb with gridfs and would like to know how I can split only the gridfs files over two servers and serve those files from both those servers.
[21:44:02] <Raynes> I have a collection named "help", and I'm trying to figure out how on earth I can reference this collection in the mongo shell. db.help doesn't work because help is a function in db. Any ideas? :(
[21:44:48] <cheeser> db.getCollection('help').find()
[21:44:55] <cheeser> also, rename that collection :)
[21:45:20] <Raynes> Is there any real reason to rename it?
[21:45:35] <Raynes> Besides the fact that I didn't know getCollection exist.
[21:45:36] <cheeser> db['help'].find() works, too.
[21:45:38] <Raynes> existed*
[21:45:48] <cheeser> well, to remove that source of confustion.
[21:45:50] <Raynes> db['help'] actually returns the function
[21:46:15] <cheeser> then use geCollection()
[21:46:24] <Raynes> Awesomesauce!
[21:46:25] <cheeser> and rename that collection
[23:12:22] <shoshy> hey, i have a collection with objects that each has "parent_ids" and "children_ids" string array, filled with _id of the object themselves (building hierarchy). I'd like to query: "all the objects that their parent_ids's size is 0 or the ones that their parent_ids array has none of the parent_ids (we found before)" can i do this in a singe aggregate?
[23:13:38] <shoshy> (meaning : (a)bring back only the roots (b) only the leafs that has no parents/ their parents aren't from (a) )