PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 14th of January, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:20:11] <sirious> if your shard key is in an embedded document, is it sufficient to include the entire embedded document when doing updates and saves? or do you need to reference the shard key explicitely?
[02:47:58] <nineteeneightd> I'm having trouble convincing pymongo to respect my value for read_preference
[02:48:09] <nineteeneightd> No matter what I set it to, everything seems to hit the master
[02:50:08] <nineteeneightd> Instantiating the client like so: MongoReplicaSetClient("host1:27017,host2:27017,host3:27017", replicaSet="foo", read_preference=ReadPreference.SECONDARY)
[02:51:16] <nineteeneightd> Anyone have any thoughs?
[03:55:52] <strangewildthing> is it possible to create a second collection that is basically exactly the same as the first collection, but with sort and limit applied to it?
[03:56:08] <strangewildthing> all changes to the original collection will be reflected on to the second collection
[03:56:16] <cheeser> so basically the output of a query.
[03:56:22] <cheeser> no, it's not.
[03:56:32] <cheeser> you want a view basically, yes?
[03:56:48] <strangewildthing> cheeser: yes a view
[03:56:53] <strangewildthing> yup the output of a query
[03:57:01] <strangewildthing> my database driver does not have sort/limit implemented yet
[03:57:27] <strangewildthing> so i need to have a separate collection for every query that implements sort/limit
[03:57:32] <cheeser> what driver is that?
[03:58:08] <strangewildthing> its from a javascript platform called Meteor.js
[03:58:28] <cheeser> you can't use mongoose?
[03:58:32] <strangewildthing> nope
[03:58:41] <strangewildthing> I'm stuck to just that incomplete driver
[04:00:36] <cheeser> you're kinda hosed then
[04:00:41] <strangewildthing> uhoh
[04:02:14] <sirious> does anyone know how to use 'shard_key' in meta to point to a field in an embedded document?
[05:24:29] <mrmowgli> Anyone know how I can do a find field1 = 1234 OR field2 = 1234?
[05:25:22] <mrmowgli> $in seems like it's not a top level specifier
[05:25:35] <redsand_> $or : array('key'=>value, 'key2' => value)
[05:25:49] <mrmowgli> basically redsand_ thanks!
[07:00:32] <huy> when i dropped my capped collection, the disk space didn't free up. What could I do to free up my diskspace?
[07:11:37] <mayanks43> Anyone knows how to use findAndModify in C++?
[08:02:16] <luca3m> mayanks43: use runCommand
[09:00:00] <stefuNz> Hey there! I'm using mongodb 2.4.8 and i'm having a replica set with three equal machines. After using MongoDB for over 6 months without any problems, MongoDB crashed with this log: http://pastebin.com/jnef9rS5 --- I was writing a lot of documents at that time. Seems like a bug? All three mongo-nodes went down...
[09:05:02] <ncls> "duplicate key error"
[09:05:19] <stefuNz> ncls: how can that crash a whole replicaset?
[09:05:35] <ncls> I don't know ..
[09:05:57] <stefuNz> should i open a bug report?
[09:06:37] <ncls> it's weird, but I can't answer that, you should get the info from a MongoDB guy
[09:06:49] <stefuNz> i'll open a jira issue
[09:07:07] <ncls> it's in your index
[09:07:39] <ncls> (the "duplicate key error" is not on the collection, it's on the index of the "competition" collection)
[09:07:54] <ncls> I think
[09:08:19] <ncls> maybe you should fix something also, to prevent any new crash
[09:08:22] <stefuNz> yeah, i mean that would be fine if it was returned to my application as an error, but crashing the whole replica set seems very, very odd
[09:08:28] <ncls> yes of course
[09:08:33] <stefuNz> it's the first time it crashed after 6 months
[09:08:56] <stefuNz> and i'm solely using ensureIndex so it shouldn't add the index if it exists
[09:09:26] <ncls> yes that's weird
[09:36:49] <mayanks43> How to force inserts to show up in mongodb?
[09:37:12] <mayanks43> They aren't appearing in db.collections.find()
[09:37:37] <luca3m> if they don't appear, there was something wrong
[09:37:44] <luca3m> check insert error
[09:37:54] <mayanks43> but I am using C++ and I didn't get any error
[09:38:24] <luca3m> by default c++ doesn't check errors
[09:38:35] <luca3m> your have to call checkError after insert command
[09:38:36] <mayanks43> hmm ok
[09:38:40] <mayanks43> thanks
[09:38:48] <luca3m> you're welcome!
[11:59:06] <includex> hi guys, I've a repset almost working, what roles should I give to the "super mega ulta" admin? just clusterAdmin or anything else?
[13:47:29] <ikss> hello
[13:47:42] <ncls> hello
[13:47:59] <katspaugh> Hi! What is more correct in MongoDB – a large single collection with entries having a common field or multiple collections that consist of entries with a corresponding common field?
[13:48:15] <ikss> db.words.find({base: 'filmik', markers: {$in: ['subst','pl']}}) - this way, i can find all records where markers array contains subst OR pl string, is there any way to find rows which contains all of words in that array? so subst AND pl?
[13:49:03] <katspaugh> db.words.find({base: 'filmik', markers: {$and: { $in: ['subst'], $in: ['pl']}}})?
[13:49:39] <ikss> hm, invalid operator $and
[13:49:57] <Derick> $and needs an array ([..])
[13:49:58] <katspaugh> Oh wait, object can't have identical keys.
[13:50:00] <Derick> not an object {}
[13:50:51] <Derick> { $and: [ { markers: { $in: ['subst'] } } , { markers: { $in: ['pl'] } } ] }
[13:51:07] <Zelest> ([..]) <-- looks like a robot listening to music with huge headphones. :D
[13:51:15] <Derick> hege
[13:51:17] <Derick> hehe
[13:52:52] <ikss> db.words.find({base: 'filmik', markers: { $and: [ { markers: { $in: ['subst'] } } , { markers: { $in: ['pl'] } } ] }}) - results with error: { "$err" : "invalid operator: $and", "code" : 10068 }, hmm
[13:53:06] <Derick> markers: { $and: is wrong
[13:53:14] <Derick> you need to remove "markers: {" from that
[13:53:15] <ikss> oh, db.words.find({base: 'filmik', $and: [ { markers: { $in: ['subst'] } } , { markers: { $in: ['pl'] } } ] }) - now works
[13:53:20] <Derick> yup
[13:53:25] <ikss> thank You ;)
[13:53:27] <Derick> but you can just do:
[13:53:37] <Derick> { markers: { $all: ['pl', 'subst'] } }
[13:53:42] <Derick> so:
[13:53:51] <Derick> db.words.find({base: 'filmik', markers: { $all: ['pl', 'subst'] });
[13:54:41] <ikss> even better, thanks ;)
[13:56:09] <katspaugh> So, supposing I have records like this: { type: 'common', value: 1 }, { type: 'common', value: 2 }, { type: 'special', value: 3 } – should I make 2 collections – "common" and "special" – or just use find to filter them by type?
[14:20:25] <JPMateo> Hi guys, who knows how to do mongodb streaming in hadoop?
[14:21:31] <JPMateo> Im experiencing problems like this java.lang.ClassNotFoundException: com.mongodb.hadoop.streaming.MongoStreamJob
[14:22:46] <JPMateo> Hello anybody here?
[14:29:42] <JPMateo> hello
[14:29:43] <JPMateo> ?
[14:32:10] <cheeser> way to stick with it!
[14:32:15] <cheeser> i actually fixed that bug this week. :)
[16:35:55] <fabiobatalha> Hello guys!
[16:37:15] <fabiobatalha> anybody knows why the distinct wrapper takes a while to processing a query, even if the key/field is already indexed?
[16:38:16] <fabiobatalha> My database have 440.000 documents and the distinct returns an array with 1185 itens.
[16:46:25] <Nodex> can you run an explain on yoyr query
[16:47:40] <Nodex> it's probably effected by this https://jira.mongodb.org/browse/SERVER-2094
[17:16:17] <mayanks43> Anyone used mongodb to store and retrieve C++ objects as binData?
[17:48:45] <mehola> I have a document with an embedded list. is there a way to query to see if that list intersects with a given list?
[17:52:12] <Joeskyyy> mehola: Do you mean to say you have list a) "{foo, bar, baz}" which is stored in mongodb, you want ot have a query to compare list b) "{foo, ber, baz}" with it?
[17:52:23] <mehola> yes
[17:53:20] <mehola> I know of the the $all operator
[17:53:55] <mehola> but is there say an $any operator? or equivalent?
[17:55:10] <Joeskyyy> $in
[17:55:15] <Joeskyyy> http://docs.mongodb.org/manual/reference/operator/query/in/
[17:55:24] <mehola> will it work when the left side is a list?
[17:56:14] <Joeskyyy> that's the part im not entirely sure on, I know it works on arrays :\
[17:57:05] <mehola> hmm
[17:57:28] <mehola> I think it will work!
[17:57:29] <Joeskyyy> So theoretically, yes?
[17:57:35] <Joeskyyy> yeah, I can't imagine why not
[17:57:57] <mehola> I thought the left hand side of the operator had to be a singular field
[18:13:27] <savant> Hi all
[18:13:39] <savant> Do all the mongodb clients require a driver?
[18:13:47] <savant> or is there a client that is lightweight?
[18:14:01] <savant> sort of like how you can talk to redis via netcat
[18:18:20] <algernon> if you can talk BSON over netcat, you don't need a driver.
[18:18:53] <algernon> (in other words: you need a client/driver/whatever you call it. there are fairly light ones out there.)
[18:20:23] <savant> mmm
[18:20:25] <savant> ok
[18:20:32] <savant> thanks for the response
[18:26:54] <mehola> Joeskyyy: thanks a lot.
[18:27:01] <Joeskyyy> No problem (:
[19:04:18] <stashspot> is there a query i can pass to .find() that would generate an error in the callback
[19:04:32] <stashspot> i need to test error handling so i need a way to test generating an error
[19:07:04] <cheeser> pass it an invalid document?
[19:07:17] <cheeser> db.collection.find({bob: }) ?
[19:09:51] <stashspot> cheeser: that generates a syntax error, not a mongo error
[19:10:27] <Joeskyyy> Why not use getLastError?
[19:10:28] <Joeskyyy> http://docs.mongodb.org/manual/reference/command/getLastError/
[19:11:08] <cheeser> stashspot: ah
[19:11:56] <stashspot> Joeskyy: that's not what i need. i don't have any errors so that won't return anything. plus, i need to test error handling from the mongodb .find callback
[19:12:19] <Joeskyyy> It will return null if you have no errors, otherwise it will report an error.
[19:12:32] <Joeskyyy> if !null do this stuff
[19:12:46] <stashspot> its not what i need
[19:12:50] <Joeskyyy> Roger.
[19:13:11] <stashspot> i'm not going to call getLastError if(err) since err will contain the err object
[19:13:21] <stashspot> i just need a way to generate err
[19:13:37] <cheeser> you could execute an insert on a secondary
[19:14:59] <stashspot> yea, it looks like also taking down my replica sets will gen an err
[19:32:42] <astronouth7303> was today the day twitter shut down something?
[19:33:38] <astronouth7303> oops, wrong channel
[19:38:23] <generic_nick> hi
[19:38:41] <generic_nick> i noticed on mongostat --discover that one of my nodes just says: "no data"
[19:38:52] <generic_nick> when i ssh into that node mongo is running and if fact it's actually the primary!
[19:39:05] <generic_nick> running mongostat just says: "connected to 127.0.0.1" and doesnt print anything
[19:39:07] <generic_nick> any ideas?
[19:40:56] <Joeskyyy> What's your mongod bind addr set to?
[19:41:38] <generic_nick> 127.0.0.1:27017
[19:41:54] <Joeskyyy> Hmmmmm
[19:41:54] <generic_nick> actually 0.0.0.0 i think
[19:42:01] <generic_nick> regardless...
[19:42:16] <Joeskyyy> And you can connect to mongo just fine with just "mongo"?
[19:42:47] <generic_nick> well i can connect but now "show dbs" has frozen on me
[19:43:15] <Joeskyyy> Sounds like something is up with your instance then. Have enough RAM?
[19:43:16] <generic_nick> it works fine on the secondaries
[19:44:05] <generic_nick> i have 64gigs of RAM and it looks like about half is being used currently according to htop
[19:46:11] <Joeskyyy> By chance you didn't eat up connections did you?
[19:46:18] <Joeskyyy> db.serverStatus().connections
[19:46:25] <Joeskyyy> That's the only other crazy thing I can think of o.O
[19:46:35] <generic_nick> i believe i went through this song and dance with ulimit before, but it's possible it didnt apply
[19:47:14] <generic_nick> { "current" : 1018, "available" : 18982 }
[19:47:58] <generic_nick> oh this is amusing, now my secondaries say no data but the primary does produce data, i think i just have too much load
[19:48:07] <Joeskyyy> Very well could be.
[19:48:32] <Joeskyyy> Lot's of writes can cause a DB lock, but mongostat should have behaved in that instance… usually.
[19:50:03] <generic_nick> maybe i can get my company to buy us ssds now :p
[19:50:26] <Joeskyyy> Tell them it's mission critical
[19:50:29] <Joeskyyy> they love that word.
[19:53:27] <generic_nick> heh true
[20:50:21] <bmw0679> Hello all, I was wondering if it was possible to use mongodump to create a dump file that has a limited number of documents in each collection. Is anyone familiar with how to do that?
[20:55:06] <cheeser> mongodump --query "..."
[21:07:23] <bmw0679> thanks cheeser
[21:07:54] <cheeser> np
[21:18:03] <bmw0679> cheeser: I can't seem to find how to add a limit for mongodump -q that would effect every collecetion. Do you know how that would look?
[21:18:24] <cheeser> oh, you'd probably have to do one mongodump call per collection
[21:19:03] <bmw0679> bummer. might be simpler to write a script
[22:18:04] <darius93> what can i do to secured mongodb?
[22:20:12] <Joeskyyy> http://docs.mongodb.org/manual/administration/security/
[22:20:14] <Joeskyyy> (: