PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 1st of May, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:02:55] <Sxan> federated_life: Thanks!
[00:05:15] <federated_life> no worries, free support ;)
[02:16:08] <nackjicholson> Anybody at this portland MongoDB talk
[02:19:26] <doktrin> hello, I'm brand new to mongo. in the following statement, what is the closest relational DB analogue to "foo" - a DB, or a table? db.foo.save({ stuff:"blah"})
[02:24:05] <preaction> doktrin, a collection ("foo") is most-closely related to a "table". "db" is the "database"
[02:30:49] <doktrin> preaction : thanks!
[02:31:52] <doktrin> I noticed that everything seems to be namespaced in the db 'test' (i.e. db.foo returns "test.foo", & db.test -> "test.test") - where is the 'test' db name set?
[02:33:12] <preaction> look at the first line when you ran "mongo"
[02:33:54] <doktrin> fair
[02:33:56] <doktrin> :)
[02:34:02] <preaction> it's the default database. you can specify your own on the command-line "mongo mydb", or inside using "use mydb"
[02:34:13] <doktrin> wow that's stunningly simple
[02:34:56] <doktrin> i guess I'm kind of over-used to postgres, where I have to basically sacrifice a few stray animals to get a db initialized
[02:35:07] <doktrin> bad joke
[02:49:38] <jonesy> hi all. Got a question about monitoring replication lag. I was figuring it should be done using db.printSlaveReplicationInfo and db.printReplicationInfo (comparing the 'syncedTo' and 'oplog last event time' & setting a threshold on the difference). I'm seeing a check right now that uses 'rs.status()', and just compares optimes.
[02:50:02] <jonesy> I thought rs.status optimes were the times of the last operation on each node, not the 'syncedTo' time.
[02:50:32] <jonesy> are optime and syncedTo time on the slaves the same thing?
[02:52:01] <doktrin> \quit
[08:07:52] <pilgo> Hello all
[08:08:03] <pilgo> I'm trying to remove an array field from 'lists' document.
[08:08:36] <pilgo> The following keeps giving me "Invalid modifier specified $unset" : db.lists.update({}, {$unset : { 'users' : 1}}, false, true)
[08:08:41] <pilgo> Ideas, please?
[08:14:23] <Nodex> $unset unsets a key, if you want to remove the entire array just $set it to null
[08:15:11] <Nodex> plus yo're using $unset wrong ... db.collection.update( { field: value1 }, { $unset: { field1: "" } } );
[08:18:30] <pilgo> Nodex: Thanks
[08:18:46] <pilgo> Setting to null worked.
[08:19:41] <pilgo> However, I can't unset 'users' field yet
[08:19:50] <pilgo> db.lists.update({}, {$unset: {users: ""}}) still throws same error
[08:20:13] <pilgo> Nodex: ^
[08:25:44] <Nodex> which mongo version?
[08:58:25] <andre_fff> Hi there
[08:58:52] <andre_fff> I have a doubt if I am choosing the right schema to a one to many relationship
[08:58:57] <andre_fff> anyone there?
[09:06:15] <andre_fff> Hi
[09:10:48] <Nodex> generaly dont join
[09:12:26] <pilgo> Wow, something really weird is happening
[09:12:49] <pilgo> out of the blue, I'm getting MongoError: E11000 duplicate key errorindex
[09:13:13] <ron> OMG
[09:13:41] <Nodex> it's probably a dupe key on a unique index
[09:14:18] <pilgo> Nodex: How do I get rid of that index?
[09:14:49] <Nodex> remove it
[09:15:14] <Nodex> db.foo.dropIndex('the_index_name');
[09:15:35] <pilgo> Nodex: Thank you!
[09:16:03] <Nodex> :)
[09:16:13] <Nodex> you can get the index name with db.foo.getIndexes();
[09:18:21] <pilgo> Nodex: Thinking I should back this up. ….just in case I mess up more than I already ahve
[09:18:23] <pilgo> have*
[09:43:44] <Nodex> oki doki
[10:41:13] <landstalker> morning all
[10:41:46] <landstalker> quick straw poll, which version of MongoDB are you all running if any?
[10:42:53] <landstalker> we're currently running 1.8.4
[10:43:41] <kali> 2.4.1, bumping to 2.4.3 tomorrow
[10:43:51] <ExxKA> Hey guys. Yesterday I was in here asking about how best to extract the date from an _id field for using aggregation/mapReduce. I wrote a short article about it, and also about how to create _ids with a custom time and date. Enjoy! http://bit.ly/14TJsyz
[10:43:51] <kali> 1.8, man
[10:43:58] <kali> this is old
[10:44:53] <landstalker> correct, we like to say, production :)
[10:45:54] <landstalker> what are your experiences of restoring using mongorestore? I did a test complete restore yesterday of an 83GB backup which when installed created 173GB of data. It took around 8 hours
[11:43:38] <bartzy> kali: You here perhaps ?
[11:44:30] <bartzy> I need to save a hex in a _id field
[11:44:34] <bartzy> I can save it as string
[11:44:42] <bartzy> or I can save it as an integer.
[11:44:46] <bartzy> what is better ?
[13:30:22] <gheegh> hey all, i'm fighting a cursor not found message. I'm curious about opinions. If I need to retrieve a small amount of data from maybe 100,000 documents (3 of 100 fields), am I better off iterating over the collection to get it pulling only that data, OR am I better off doing 3 queries asking for just the unique value of each of those fields?
[13:47:57] <Baastrup> Hello, maybe someone could offer some insight. When using the $sort modifier with $push, is it possible to set a $slice of unlimited? ..or; why isn't it?
[14:07:00] <gheegh> hey all.. quick question.. i'm trying to find documents with an integer value that is within X of another document in the same collection.. ideally, i'd like to do a query that just returns those values.. this will be over about 100,000 documents.. is there a better way to do this in mongo other than just iterating over the collection to grab those values?
[14:07:52] <kali> gheegh: this is the equivalent of a self join... not something mongodb likes very much to do :)
[14:08:19] <gheegh> kali: yeah, i know.. sigh.
[15:43:44] <dukedave> Is it still true that MongoDB does *not* support compound indexes containing a 2d index, but not starting with the 2d index? As per: http://stackoverflow.com/questions/7986027/geospatial-indexing-with-a-simple-key-first
[15:51:56] <akrs> Hey guys - i'm trying to find the most commented items from a collection where comments are a property (array). aggregation framework gets me the item ids, which i then pass to a where-in call, but the come back unsorted, so I have to re-order them manually. Is there a simpler way to get this set? Thanks.
[16:01:17] <Nodex> I think you can apply a sort to it
[16:01:21] <Nodex> look at $sort
[16:04:30] <idea-users225> Hi! MongoClient is throwing "java.net.UnknownHostException" even though I localhost loop setup in my /etc/hosts and can ping it from terminal
[16:04:46] <idea-users225> How can I fix it?
[16:29:32] <dukedave> Can someone sanity check this comment I just made: http://stackoverflow.com/questions/5125521/uses-for-mongodb-objectid-creation-time#comment23373272_5128574
[16:30:53] <Nodex> the one with 5 votes?
[16:31:11] <Nodex> "db.collection.find().sort({ _id : -1 }).limit(10)" ?
[16:31:46] <dukedave> Nodex, no, the last comment on the accepted answer
[16:31:49] <dukedave> the one by dukedave :)
[16:32:51] <Nodex> _id -1 is the same as timestamp -1 for all intents and purposes
[16:33:00] <dukedave> I'm about to write some code which depends on what I said being correct
[16:33:17] <Nodex> on sharded / replicated systems there is not clashes so this means that TRUE sorting can always occur
[17:05:45] <aknewhope> Are there any modern PHP frameworks with support for MongoDB?
[17:05:56] <aknewhope> Laravel and FuelPHP not so muchh yet
[17:24:43] <akrs> Nodex, can't sort on length of a property (e.g. Item.comments.length) - unless I'm mistaken.
[17:48:48] <JoeyJoeJo> I have fields in my collection which represent points of a polygon. Does mongo have any function that can tell me if two polygons intersect?
[17:51:22] <gazarsgo> i think you'll need to conform to GeoJSON if you want to use mongo's spatial stuff
[17:52:14] <gazarsgo> http://docs.mongodb.org/manual/reference/operator/query-geospatial/#geo-overview-location-data
[17:52:59] <JoeyJoeJo> thanks
[17:58:48] <JoeyJoeJo> I have one more question - I want to delete duplicates. I consider two documents to be duplicates if field1 and field2 are the same in each document. I then want to delete the document which has the greatest value in field3. Is that something I can do in mongo or would I have to do that in my app?
[18:02:29] <TkTech> Does $and not work on arrays? I'm trying to find all documents where the array "products" has a sub-document with field == 1 but no sub-document with field == 2
[18:04:40] <Infin1ty> someone accidentatly ran a query using "id" instead of "_id", it created a huge load on the database, i killed those operations, but yet, they appear to come again with new opid
[18:04:58] <Infin1ty> the cluster is now in some kind of a loop because of querying by "id" instead of "_id" and i can't kill those operations
[18:05:31] <jrdn> is there a way to see the write concern in the profiler?
[18:08:44] <Tark|2> if I do follow: db = MongoClient().dbname in global part of my script, it won't use a pool, isn't it?
[18:58:35] <jsonperl> im having trouble using mongostat with auth enabled
[18:58:48] <jsonperl> how do I need to setup a user to allow them to connect via mongostat?
[19:05:17] <hobbinator> I am trying to use Python streaming in the Mongo Hadoop connector. I am getting a ClassNotFoundException for MongoStreamJob. However, documentation states that the streaming-assembly jar file should compile since I am using a Hadoop version 0.23.x
[19:06:06] <hobbinator> I am specifically using 0.23.7, should I roll back to 0.23.1, or are there any other dependencies that should be in my hadoop/lib folder?
[19:16:04] <pr_op> Im getting an error with nonAtomic out flag in pyMongo. Using a reduce action, tried the same parameters in console w/o issue.
[19:16:43] <jsonperl> is anyone intimately familiar with the security setup in 2.4
[19:16:43] <jsonperl> ?
[19:18:07] <pr_op> pymongo.errors.OperationFailure, failed: exception: unknown out specifier [nonAtomic]. works in console, not pymongo
[19:18:16] <pr_op> out options are: "out":{
[19:18:16] <pr_op> "reduce":"score_merge_test",
[19:18:16] <pr_op> "nonAtomic":True,
[19:18:16] <pr_op> }
[19:55:56] <tjmehta> Hello everyone, is there a mongo query operator that determines whether a document key is not an array?
[19:56:35] <tjmehta> jk just found it: it is $type
[21:04:56] <mali> Hi, is it a bad idea to run config servers on the same boxes as replicas?
[21:05:12] <mali> Must I have 3 extra boxes for config servers in production deployment?
[21:05:36] <kali> mali: it used to be fine, but since 2.4, config server are eating a bit too much ram and cpu for my taste
[21:05:50] <mali> kali: how much, ballpark?
[21:06:08] <mali> I'm probably going to use aws mediums
[21:06:11] <jrdn> one billion
[21:06:15] <jrdn> muahahaha
[21:06:17] <jrdn> jk
[21:06:32] <kali> mali: medium should be fine :)
[21:06:47] <mali> jrdn: heh
[21:07:05] <mali> we'll see I guess
[21:07:57] <kali> start with medium, but don't reserve them...
[21:08:23] <mali> yeah, probably not until we're sure how much ram we're using
[21:08:33] <mali> this is also sharded so actually it might not be bad
[21:08:39] <mali> if we run out we can always add more shards
[21:35:03] <mgriffin> anyone else doing the free/online mongo training that started on monday?
[21:36:37] <mgriffin> i can't find the forum they mention as being available for students
[21:38:13] <Almindor> if you do a find and it uses a compound index (say 3 keys 1st being the '2d'), is there a way to see if it actually used the two other parts of it?
[21:38:39] <Almindor> I got a find which boxes 3.8 million documents
[21:38:55] <Almindor> but the time/otherid fixes that to 3k
[21:39:09] <Bilge> Can a mongo database be dumped to a stream instead of a series of fixed files?
[21:39:17] <Bilge> I want to be able to compress the output without it touching the local file system
[21:41:08] <mali> Almindor: .explain() on the query maybe?
[21:41:33] <Derick> afaik it doesn't show that
[21:42:32] <Almindor> mali: I don't see if it actually hit anything on the secondary index keys..
[21:42:54] <Almindor> I guess I can compare the n/nscanned
[21:43:06] <Almindor> and do find on just the box itself to count that
[21:45:24] <mgriffin> I didn't see anything in http://docs.mongodb.org/manual/reference/explain/ (eg mysql uses key_len in explain output)
[21:45:38] <mgriffin> Bilge: mongodump?
[21:53:24] <mali> Almindor: Ah, sorry, that's as far as my knowledge goes
[21:54:13] <mali> Can you convert a delayed replica into a regular one after the fact?
[22:04:47] <glitch273> Hello, I'm having some trouble googling this but how would I setup a simple string Enum type (ie. for status like "active" or "dismiss")? I'm using MongoEngine.
[22:43:24] <[Neurotic]> Don't suppose there is anyone in here that takes care of the Ruby driver for Mongo?
[23:19:04] <someone> hi
[23:19:29] <Guest17034> im trying to set up a mongoDB replica set
[23:21:56] <liubei> i have 3 mogod in a replica set, running in 192.169.1.1 each one in a port (27017, 27018, 27019)
[23:22:54] <liubei> im using pymongo to connect to replica set:
[23:23:14] <liubei> MongoClient("192.169.1.1:27017", replicaset='rs0', read_preference=mongo.ReadPreference.SECONDARY)
[23:23:42] <liubei> so when i shutdown the primary to test, i receive the error :
[23:23:50] <liubei> could not connect to 192.169.1.1:27017: [Errno 111] Connection refused
[23:24:05] <liubei> could someone help me?