PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 28th of March, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:15:06] <kongthap> hi, i'm reading doc at mongodb.org function and server-side javascript function are the same thing ?
[02:48:03] <pomke> On an update with upsert true, how would one set a 'created' timestamp only of the object is being created and not if it is being updated?
[02:58:42] <mongodb> Is there a way to see that "Get me all documents such that there's an element in array which is between 1 and 4?"
[02:59:26] <mongodb> as an example, document is {array: [1, 4] } and it shouldn't match this query
[02:59:38] <mongodb> but {array: [2, 3]} should.
[02:59:55] <mongodb> and {array: [2, 3, 100] } should also match.
[03:00:17] <joannac> $elemMatch and $lt, $gt ?
[03:00:44] <joannac> dammit, pomke is gone, i think he wanted $setOnInsert
[03:01:51] <mongodb> joannac: thanks! seems to do the trick
[03:31:21] <LoneSoldier728_1> if I am using $or
[03:31:31] <LoneSoldier728_1> is there a way to tell which condition was matched?
[05:06:14] <Froobly> hi. using mongoose, validations on my subdocument are running for every subdocument each time any of them is updated. is there a way to prevent this?
[05:06:46] <Froobly> i mean, is there a way to validate only one subdocument and not care if already saved ones break validation?
[05:21:55] <Froobly> anyone?
[05:35:38] <joannac> Froobly: try #mongoosejs ?
[05:36:06] <Froobly> joannac, aha, thanks
[09:05:29] <_boot> can a shard config server be run on a db which is also used for other purposes?
[09:14:33] <thearchitectnlog> hi
[09:14:58] <thearchitectnlog> can anyone help me with to query two related document into one embed document mongodb
[09:15:11] <Nodex> eh?
[09:15:17] <thearchitectnlog> mysql => mongo migration
[09:15:50] <thearchitectnlog> i have two related document with a foreign key i need to embed the child in the parent using a querry
[09:16:57] <Nodex> and what do you have a problem with?
[09:17:22] <thearchitectnlog> building the query just that
[09:17:35] <Nodex> what do you have so far?
[09:18:18] <thearchitectnlog> var child = db.child.find(); for (i=0;i<child.length();i++){var parent = db.parent.find({p_id: child[i].parent_id})[0].p_name;print(parent);}
[09:19:09] <Nodex> do you not have a server side language you can do it in?
[09:19:09] <thearchitectnlog> m getting the parent of the child i need to insert the child into the parent
[09:19:09] <thearchitectnlog> then delete the child
[09:20:39] <thearchitectnlog> i have to do it with mongo query
[09:20:40] <thearchitectnlog> from terminal
[09:21:44] <thearchitectnlog> nodex can u help me to finish it ?
[09:21:55] <Nodex> not from the terminal no sorry
[09:24:31] <thearchitectnlog> nodex node js than
[09:26:04] <Nodex> ok, write your script and pastebin it
[09:33:38] <thearchitectnlog> nodex just give me an example with any driver u want with just a parent and a child
[09:33:50] <thearchitectnlog> i ll figure it out
[09:34:19] <Nodex> It's not rocket science
[09:34:38] <Nodex> loop the children and insert themselves as a $set into the parent
[09:34:51] <Nodex> it doesn't really get any simpler than this
[09:56:32] <thearchitectnlog> yea than it s simple also to do it in the console
[10:02:14] <Nodex> ok, good luck :)
[10:15:00] <ajph> hello. we've been having issues with a mongod instance stopping on one of our production servers. there's nothing in the log - it just stops. can anyone advise how i can further debug this issue?
[10:15:19] <Nodex> disks full?
[10:15:46] <ajph> disk isn't full - checking ram
[10:16:40] <ajph> nope - it wasn't killed by the OS
[10:17:27] <kees_> something in dmesg like a segfault?
[10:21:43] <ajph> ah our filesystem is fucked
[10:21:49] <ajph> :/
[10:34:21] <Nodex> oh dear
[12:43:29] <Gr1> Hi everyone
[12:43:49] <Nodex> nobody is here
[12:44:46] <Gr1> :(
[12:45:16] <Gr1> Its friday, and everyone must have taken off already :S
[12:49:08] <Nodex> lol
[12:49:14] <Nodex> best to just ask your qustion
[12:49:17] <Nodex> question*
[12:50:24] <cheeser> friday's just getting started!
[12:50:55] <Nodex> 2/3rds way through for me
[14:50:50] <h0bbit> Nodex, night time for me :)
[15:02:29] <Froobly> i mean, is there a way to validate only one subdocument and not care if already saved ones break validation?
[15:02:59] <Froobly> oops ;) i meant, using mongoose, validations on my subdocument are running for every subdocument each time any of them is updated. is there a way to validate only one subdocument and not care if already saved ones break validation?
[15:33:41] <davonrails> Hi guys
[15:35:15] <davonrails> I’m trying to install mongo server on a server on which mongo client is already installed, the thing is I got a yum « conflits with »  bug … Is there anyone who know how to solve that kind of thing ?
[15:41:34] <Nodex> put a docker image on the server and install it into that?
[15:41:44] <Nodex> or remove the mongo client and install the whole thing
[15:47:58] <davonrails> that’s fine I just uninstalled the older version thanks anyway
[17:10:13] <Froobly> using mongoose, validations on my subdocument are running for every subdocument each time any of them is updated. is there a way to validate only one subdocument and not care if already saved ones break validation?
[18:09:49] <laprice> I'm trying to add a user and keep getting " Error: couldn't add user: "createUser" command requires a "roles" array at src/mongo/shell/db.js:1007 "
[18:10:48] <laprice> The documentation on updgrading to 2.6 mentions that that is a difference, but this is a fresh install from the mongodb.org packages
[18:11:23] <hairyhenderson> Hi folks, I'm having some trouble with using a tailable cursor with the nodejs mongodb driver
[18:11:45] <laprice> Poking around the 2.6 docs doesn't give me any guidance as to where to create the "roles" array or what should be in it.
[18:12:06] <hairyhenderson> I'm using the cursor.stream() method and I don't seem to be getting any data events, even though I know documents are being added to the collection
[18:12:11] <hairyhenderson> any hints on debugging this?
[18:27:12] <proteneer> is there a reason not to put each collection in its own database to avoid the database level lock?
[18:27:34] <proteneer> i imagine sharding is one, as shards are only available at the collection level
[18:29:09] <cheeser> i have a gut feeling any performance gain you might get (and i doubt there's much) would be outweighed by the complexity of managing multiple DBs in one app.
[18:38:43] <jennr> hello mongo peeps
[18:38:58] <jennr> i am trying to connect to a remote mongo server and run a .js
[18:39:09] <jennr> it is giving me a connect failed error
[18:40:17] <jennr> ex. mongo -u username -p password --host theplaceiwant.com:27017/thatdb thejs.js > out.json
[19:15:29] <ekristen> what is a good number of page faults in mongostat?
[19:15:39] <cheeser> 0
[19:21:05] <ekristen> k
[20:10:30] <codygman> Are sparse indexes bad for nested data? I have some data that looks like {"value": "clicks": {"value": "thevalue"} I can't change and I'm trying to figure out how to access it somewhat efficiently.
[20:14:27] <durre> is there an easy way to set a new field in all document, to the value of another field on the document? I could do it with backend code
[20:27:04] <proteneer> when will MongoDB 2.6 be released?
[20:27:23] <cheeser> "Real Soon Now(tm)"
[20:27:48] <proteneer> waiting on a new version of motor, which is waiting on a new version of pymongo 2.7, which is waiting on a new mongo
[20:27:49] <proteneer> T_T
[20:29:15] <cheeser> yeah. the java driver is in the same waiting game.
[20:38:35] <harlanhaskins> I'm having some trouble making a query.
[20:38:59] <harlanhaskins> My users look like this:
[20:39:21] <harlanhaskins> http://i.imgur.com/qVP3iCO.png
[20:39:50] <harlanhaskins> I'm trying to write a query that'll find if a given device token exists in a user, within either 'ios' or 'android'.
[20:40:02] <harlanhaskins> I'm using pymongo.
[20:40:19] <harlanhaskins> So my query looks something like this: {'deviceTokens': {'$in': {'$or': [{'android': {'$in': ['Token']}}, {'ios': {'$in': ['Token']}}]}}}
[20:41:19] <harlanhaskins> Can anyone help me makr a query that works?
[20:41:21] <harlanhaskins> make*
[20:41:40] <proteneer> cheeser, there isn't that much complexity to managing additional dbs
[20:41:47] <proteneer> (sorry i jsut read the reply)
[20:43:30] <cheeser> proteneer: huh?
[20:43:42] <proteneer> i have a gut feeling any performance gain you might get (and i doubt there's much) would be outweighed by the complexity of managing multiple DBs in one app.
[20:43:46] <proteneer> ^
[20:43:58] <cheeser> oh. going way back. :)
[20:50:20] <harlanhaskins> Any ideas?
[20:54:16] <tscanausa> is there a way to see which shards are moving around?
[20:54:28] <skot> {"$or":[{"deviceTokens.android":token},{"deviceTokens.ios":token}] }
[20:54:41] <skot> tscanausa: what do you mean by moving around?
[20:55:02] <skot> The changelog will contain a list of all chunks which are migrated between shards, if that is what you mean.
[20:55:03] <tscanausa> sorry chunks in shards
[20:55:23] <tscanausa> where can I find the changelog?
[20:55:33] <skot> use config; db.changelog.find(…)
[20:56:18] <skot> http://stackoverflow.com/questions/18103220/mongodb-chunk-migration-steps-in-changelog-collection
[20:56:31] <tscanausa> Thanks
[20:56:59] <kongthap> hi, i'm reading doc at mongodb.org function and server-side javascript function, are they the same things ?
[20:58:47] <skot> It is hard to guess what you are reading so it is hard to know if they are the same thing. If I say yes, is that good or bad for you?
[20:59:45] <skot> maybe you can read this: http://docs.mongodb.org/manual/reference/command/eval/#dbcmd.eval
[21:02:55] <kongthap> i meant, how may types of user defined functions in mongodb?
[21:03:06] <tscanausa> it looks like the drain was aborted… is there a way to kick start it
[21:29:40] <HSP40> hello everyone
[21:31:08] <HSP40> I had a quick question: would it be better to have a seperate collection for comments on a post or a sub-document
[21:31:18] <HSP40> that embeds the comments
[21:32:26] <cheeser> separate collection
[21:32:37] <tscanausa> sub document is faster access but there is a 16mb hard limit for any document
[21:33:17] <HSP40> thats no problem, the documents are all small
[21:34:31] <HSP40> now say I have a list of embedded documents for each comment
[21:34:46] <HSP40> can I delete from this list
[21:34:58] <HSP40> from what I've read I cant
[21:35:25] <tscanausa> I beleive you need an read modify write method
[21:36:16] <HSP40> what do you mean by that. Sorry im pretty new
[21:37:30] <tscanausa> you would have to read the whole document out, delete the sub document attribute then write the sub document back
[21:38:27] <HSP40> could i edit the comment without doing that?
[21:39:34] <HSP40> assuming I know its index in the list
[21:39:36] <tscanausa> well if you change the structure you might be able to get away with it
[21:41:02] <HSP40> but its the accepted practice to read modify write?
[21:41:32] <HSP40> I thought that created a race condition from what ive read
[21:41:47] <tscanausa> it would but its a flaw to using sub documents
[21:42:51] <HSP40> damn.
[21:43:22] <HSP40> I guess im gonna make it its own collection
[21:44:55] <HSP40> thanks tscanausa
[21:49:50] <cheeser> you can remove elements from an array using $pull
[21:57:04] <HSP40> what do you mean cheese
[21:57:10] <HSP40> r
[21:59:59] <joannac> cheeser!
[22:02:02] <cheeser> joannac!
[22:40:25] <ruphos> how feasible is it do gt / lt searches on _id for time ranges?
[22:44:26] <mylord> is this ok? db.turnys.update({"gId":"5335e4a7b8cf5123467890”}, {$addToSet:{"users":{"dId":"sys", "name":"sys"}}})
[22:45:01] <mylord> for this datastructure: http://hastebin.com/totuwamane.apache
[22:45:19] <mylord> it doesn’t give error, but doesn’t work, either