PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 5th of December, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:35:03] <enjawork> im having trouble getting indices to work right. when explaining nscanned is showing that its scanning my entire collection even tho i am specifying a limit in the options to my query
[00:38:03] <peterjohnson> hey all. have a question about clonecollection in mongodb if anyone could help!
[01:04:17] <qswz> when you search for the presence of *only* "bar" in the "foo" array, still always need the array notation? {"foo":{$in:["bar"]}
[01:49:35] <nocturne777> I think there's an issue with the author's code here: http://pastebin.ca/2492286
[01:50:55] <nocturne777> I just do not understand how the second 'update' request could result in "result['updatedExisting'] == true"
[01:51:18] <nocturne777> if it the upsert is successful, that field would be false
[01:51:22] <nocturne777> am I wrong here?
[02:26:58] <nocturne777> is this channel always quite like this?
[02:32:56] <nocturne777> nevermind, I get what's going on in that query
[02:34:51] <retran> yeah it's often dead in this chan
[02:55:21] <joannac> Well, Europe is asleep, the US is still out having dinner, and most of Asia Pacific is at work
[02:55:44] <joannac> irc doesn't come with an SLA :)
[02:59:44] <mongoboy> YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY
[03:00:44] <ObjectBoy> is that a dictionary in your pocket, or are you just happy to see me?
[03:01:00] <ObjectBoy> joeskyyy: sup d00d
[03:01:11] <ObjectBoy> :)
[03:05:45] <ObjectBoy> ok, i'm out
[03:05:50] <ObjectBoy> happy page faulting y'all :)
[03:13:50] <naillwind_> mongo db challenge. how is it possible to do an update with an $addToSet operation on a nested array? eg field, array, array. structure sample in this http://pastebin.com/Drgdiznn
[03:17:57] <joannac> $addToset: {"data.data": {_id: ...}}
[03:18:39] <joannac> ?
[03:19:38] <retran> how to refer to an index of array
[03:20:50] <joannac> data.data.0, data.data.1, etc
[03:21:16] <retran> .integer? really?
[03:21:21] <retran> it's not data.data[0]
[03:21:22] <retran> ?
[03:26:38] <quickdry21> Anyone know if a config server (1/3 for the cluster) going down (for backups), will cause pymongo to raise an AutoReconnect exception?
[03:30:08] <naillwind_> joannac: update: mongodb nested array where update challenge: pastebin.com/bPCmVAku
[03:30:18] <naillwind_> however, let me just check those suggestions.
[03:52:02] <aliceow> Hi, I'm very new to Mongodb and I have a documentation lookup question
[03:52:31] <aliceow> where can I find the documentation for db.collection('collection-name', callback)?
[03:52:48] <aliceow> where callback is: function(error, collection_retrieved)
[03:53:06] <aliceow> I found http://mongodb.github.io/node-mongodb-native/markdown-docs/collections.html#selecting-collections, but it doesn't specify what callback is
[03:53:53] <aliceow> yes, I know what db.collection is supposed to have in its arguments. The reason I'm asking for documentation is so that in the future I can refer to this source if I encounter something I don't know.
[03:55:01] <naillwind_> umm so in mongodb, is it not possible to perform an operation such as: db.collection.update({_id: doc}, { $push: { 'array.doc(where _id: abc).subarray': { _id: "123" }}}); somehow?
[03:56:35] <retran> http://docs.mongodb.org/manual/reference/operator/query/elemMatch/#op._S_elemMatch
[03:57:05] <retran> i'm guessing that's what you want to use in your update , naillwind
[03:59:54] <aliceow> anybody??
[03:59:56] <aliceow> :(
[04:00:30] <naillwind_> retran, thanks.. I was right on that with this as well: http://diogogmt.wordpress.com/2012/03/23/update-elementmatch-and-the-positional-operator-on-mongodbmongoose/
[04:01:21] <naillwind_> just wondered how it was possible to use it in combination with .update and $addToSet
[04:01:43] <retran> you'd use elemMatch in your update query
[04:22:56] <aliceow> nvmd guys, I found it http://mongodb.github.io/node-mongodb-native/api-generated/db.html#collection
[04:57:17] <carbonpile> does anyone have any ACL experience?
[04:58:08] <naillwind_> retran: thanks, indeed $elemMatch solved it, nice!
[05:06:07] <retran> naillwind, cool, that's great,
[05:12:42] <naillwind_> it helped adding a document to a specific collection document array array.
[05:13:32] <naillwind_> now comes the challenge of removing a specific document where _id is known from a specific collection document array array
[05:40:23] <naillwind_> cool, just as easy on the remove, from document array array specific position.
[06:03:07] <liquid-silence> guys is this possible db.collections("books").update({ "_id": book_id, $or: { "parent_id": book_id }}
[06:03:15] <liquid-silence> I get a { [Error: Server Error: $or requires nonempty array]
[06:05:37] <joannac> liquid-silence: check the syntax for $or http://docs.mongodb.org/manual/reference/operator/query/or/
[06:05:51] <liquid-silence> yeah with array
[06:05:54] <liquid-silence> it does not not work
[06:05:57] <liquid-silence> :(
[06:06:12] <liquid-silence> db.collections("books").update({ "_id": book_id, $or: [{ "parent_id": book_id }]}
[06:06:41] <joannac> well, for a start, your update doesn't have enough arcuments
[06:06:49] <joannac> and there's no close parenthesis
[06:06:58] <liquid-silence> thats only part of the query
[06:07:26] <joannac> WHy do you need an $or for only one condition?
[06:07:38] <liquid-silence> db.collection("books").update({
[06:07:40] <liquid-silence> "_id": book_id, $or: [{ "parent_id": book_id }]
[06:07:40] <liquid-silence> }, {
[06:07:40] <liquid-silence> $pull: { "permissions": { "group_id": group_id } }
[06:08:29] <joannac> WHy do you need an $or for only one condition?
[06:16:59] <joannac> liquid-silence: http://pastebin.com/wGAUdSbP
[06:29:48] <liquid-silence> @joannac will this work?
[06:30:13] <liquid-silence> db.collection("books").update({$or: [{"_id": book_id},{"parent_id": book_id }]
[06:35:06] <joannac> liquid-silence: Did you read the pastebin I linked you?
[06:35:56] <liquid-silence> yea
[06:36:07] <liquid-silence> db.books.find({$or: [{"_id": book_id}, {"parent_id": book_id}]})
[06:36:54] <joannac> liquid-silence: Does that find what you expect? If so, yes
[06:37:43] <liquid-silence> it says the result is 1
[06:38:25] <liquid-silence> joannac http://pastebin.com/XgX02LBP
[06:38:30] <liquid-silence> result is 1
[06:38:36] <liquid-silence> but it did not pull anything
[06:39:22] <liquid-silence> this should in theory update 4 documents
[06:39:35] <joannac> if you do a db.collection("books").find(....) how many results do you get?
[06:39:49] <joannac> pastebin the result
[06:42:32] <liquid-silence> return 4 items
[06:42:33] <liquid-silence> db.books.find({$or: [{ _id: "52a0154d000000487f000003"}, { parent_id: "52a0154d000000487f000003"}]})
[06:44:09] <joannac> pastebin the result please. Also what group_id is
[06:57:52] <morfin> how can i avoid of selecting same document by different users
[07:06:36] <morfin> i need to lock document for reading because one user with m
[07:06:51] <morfin> process and modify row
[07:07:13] <joannac> you want only one user to read at a time?
[07:07:20] <morfin> no
[07:08:02] <morfin> i need to let only one user access some document(other users should not be able to read\modify that document)
[07:09:54] <joannac> access = write?
[07:10:33] <morfin> as exaple user A is loading random client from database another user B should not get that client if loading random client at same time
[07:12:05] <joannac> what's a client in this context? a document?
[07:12:10] <morfin> yes
[07:12:14] <joannac> okay
[07:12:34] <joannac> if you're writing a document, that's atomic. you're not going to see a half-written document
[07:12:56] <joannac> Unless you're doing it is parts: db.foo.save(), db.foo.update(), db.foo.update()
[07:13:52] <morfin> i need read document display for user(he will fill fields etc) then he will "commit" changes and unlock
[07:15:03] <morfin> seems like that's pessimistic locking
[07:17:54] <morfin> looks like concurrency is not well implemented
[07:20:32] <joannac> morfin: http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/ ?
[07:22:54] <morfin> https://blog.codecentric.de/en/2012/10/mongodb-pessimistic-locking/
[07:22:59] <morfin> i think that's closer
[07:23:34] <joannac> I think they're basically the same
[07:23:41] <joannac> same concept, at least :)
[07:24:35] <morfin> anyway i think i need special collection for locking
[07:25:20] <morfin> i think i should check that somehow
[07:25:25] <morfin> with lots of users
[08:40:52] <Nilshar> Hello all, there is something I don't understand in my mongo setting. I'm using php driver to connect to a replicaset, giving to php master and slave host. all works fine when all servers are up, but if I shut down the slave host (not only the mongod, but all the host), then all connection to mongodb are slow (>3s), any idea why ?
[09:47:16] <bin> howdy peeps
[09:59:53] <joannac> Nilshar: what php driver version?
[10:05:23] <Nilshar> joannac: 1.4.5
[10:15:43] <joannac> Nilshar: hrm okay, newest version. Not sure then. Had a look through JIRA?
[10:18:18] <Nilshar> joannac: yep, did a lot of research... no luck..
[10:21:20] <joannac> FIle a new bug ticket?
[10:22:10] <Nilshar> maybe I will. just want to be sure that's not a conf issue or whatever is my fault ;)
[10:22:49] <joannac> Feels like https://jira.mongodb.org/browse/PHP-686
[10:24:16] <Nilshar> hum.. indeed
[10:24:39] <Nilshar> bad search skill then :/
[10:38:13] <Nilshar> joannac: but this ticket says it has been fixed in 1.4.0..
[11:05:36] <Derick> Nilshar: to figure out what happens, the best is to make a log. With MongoLog you can do tha. Let me give you a link
[11:39:57] <Derick> Nilshar: example #1 at http://www.php.net/manual/en/mongolog.setcallback.php
[12:25:21] <amaron> I have collection of parent objects with child attribute which is an array of child objects
[12:25:50] <amaron> I need to return one child (or list) of child object who match given criteria
[12:26:40] <amaron> ie. the simplest would be: Parents.find({}, { "children._id": some_id })
[12:26:51] <amaron> where I get child object
[12:27:12] <amaron> How to write proper query for that?
[12:27:51] <Nodex> you need the $ operator in terms of projection
[12:28:21] <amaron> Nodex: can you give me an example?
[12:29:53] <Nodex> something along the lines of this... db.foo.find({"children._id":someId},{"children.$":1});
[12:30:03] <Nodex> http://docs.mongodb.org/manual/reference/operator/projection/positional/#proj._S_ <--- more information
[12:30:12] <amaron> thanks
[12:51:48] <Nilshar> Derick: thanks I'll take a look
[14:02:00] <Nilshar> Derick: very useful thanks. well, it tries to connect to the slave and block everything until timeout.
[14:15:35] <ajph> hi. i'm looking for some anecdotal information to suggest what sort of performance i might get out of mongodb on various ec2 instances. anyone mind sharing?
[15:17:50] <remonvv> \o
[15:18:18] <ron> o/
[15:19:11] <ron> ugh, I was looking for you for the past two days.
[15:20:07] <remonvv> Oh?
[15:20:48] <ron> yes.
[15:24:28] <revoohc> How do you set paddingFactor on a specific collection in 2.2.4?
[15:31:44] <Joeskyyy> ^ don't think you can? https://jira.mongodb.org/browse/SERVER-1810
[15:32:27] <Joeskyyy> Only way I know how to fix padding issues is to compact.
[18:06:59] <azathoth99> hi folks
[18:07:07] <azathoth99> to seed a second prod cluster
[18:07:10] <azathoth99> whats best way?
[18:08:10] <cheeser> http://docs.mongodb.org/manual/tutorial/resync-replica-set-member/#sync-by-copying-data-files-from-another-member
[19:06:00] <jergerber> Should I expect an upgrade from 2.2.4 to 2.4.8 to go smoothly?
[19:18:06] <ranman> jergerber: http://docs.mongodb.org/manual/release-notes/2.4-upgrade/ probably
[19:37:26] <jergerber> thanks for the pointer, ranman.
[20:01:44] <othiym23> hello everybody, does anybody know what happened to node-mongodb-native 1.3.20?
[20:02:17] <othiym23> I got some complaints about it breaking New Relic's instrumentation for Node so I added some changes and tests to deal with the way it handled cursors, but now it's been pulled from npm
[20:02:55] <othiym23> side note: it's really irritating when packages are pulled from npm, because it means that the tests continue to pass on our dev boxes but fail in CI because CI doesn't have the pulled modules in cache
[20:03:15] <othiym23> putting out a new version of the module with whatever was bad reverted is *much* better for downstream consumers
[20:03:30] <othiym23> anyway, I'm wondering what happened there, and if I should nuke those tests, or what
[20:17:04] <ranman> othiym23 as I understand it the issue with 1.3.20 was an issue with NPM behavior not the driver
[20:17:13] <ranman> but I've been wrong before :P
[20:34:14] <ranman> http://splitsider.com/2013/12/people-think-the-onions-report-on-nypds-stop-and-kiss-program-is-actually-real/
[20:34:27] <joannac> ranman: off-topic
[20:34:31] <ranman> woah
[20:34:32] <ranman> wrong
[20:34:34] <ranman> wrong channel
[20:34:37] <ranman> apologies
[20:37:16] <cheeser> but you're welcome ;)
[20:37:29] <ranman> thanks cheeser
[20:51:58] <tab1293> anyone here work for mongodb?
[20:52:38] <joannac> tab1293: hrm? why do you need a mongodb employee?
[20:53:48] <tab1293> I put in an intern application and wanted to see if there was someone who I could contact to see if it was receieved
[21:06:51] <solidus-lake> hey all, i keep getting a 104 from pymongo why would this be hapening so frequently? i dont see it beign under much load
[21:07:02] <solidus-lake> what should i be paying attention to, ms of global locks?
[21:40:34] <Joeskyyy> solidus-lake: happen to know the size of the BSONs you're throwing at Mongo?
[21:41:20] <solidus-lake> Joeskyyy: no, but this is happening on a fetch is there a certain size limit i should worry about?
[21:41:39] <Joeskyyy> I believe it should be less than 16MB
[21:43:28] <Joeskyyy> Someone had a similar issue here, see their resolution/calculation in the first answer: http://stackoverflow.com/questions/11498631/connection-reset-by-peer-error-in-mongodb-on-bulk-insert
[21:44:28] <Joeskyyy> I'm not 100% sure on fetches though, maybe someone else can chime in to confirm
[21:53:14] <azathoth99> do you guys have any problems cloning a production data set into staging?
[21:53:23] <azathoth99> procedure wont work for me..
[21:53:36] <azathoth99> I end up with prod replicaset in stag
[21:53:41] <azathoth99> and it wont re intialize
[21:53:44] <azathoth99> its wont die!!
[21:53:51] <azathoth99> you cant reason with it! it doesnt feel pain
[22:07:49] <skloot> I've got a shard draining that's been stuck on one chunk remaining for hours, and there's no moveChunk in progress... is that normal?
[22:07:58] <azathoth99> nop
[22:12:33] <skloot> In case anyone's curious, I just set draining=false and then did removeShard again and it worked. Woo....
[22:12:58] <skloot> Scratch that, I'm dumb
[23:16:11] <gm99> hi everybody
[23:16:23] <gm99> can anybody tell me what "BSONElement: bad type 25" nean
[23:16:26] <gm99> means
[23:16:40] <gm99> i get it when I try to create index
[23:19:02] <Joeskyyy> bad/corrupt data?
[23:19:54] <gm99> hm! I am pretty new to mongodb, is there any way to fix it ?
[23:21:05] <joannac> Any surrounding messages?
[23:21:24] <Joeskyyy> It's a bit hard to tell… what was the last thing you did mongo related before it stopped working. Any updates or anything
[23:23:12] <gm99> Dev team had a script which was running ensureindex everytime when they were doing queries
[23:23:35] <gm99> in addition to that, daly updates and etc
[23:23:40] <gm99> daily
[23:24:13] <gm99> [conn422719] insert prod.system.indexes keyUpdates:0 exception: BSONElement: bad type 25 code:10320 locks(micros) w:19663438 19663ms
[23:24:22] <gm99> and this is from log files