PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 26th of May, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:50:30] <ryeguy_24> Hey guys, I'm using the $subtract operator on two dates and getting a value such as '103919450L'
[02:50:51] <ryeguy_24> Is subtract meant to work on dates? (need to get the number of hours between today and the record date)
[02:54:45] <ryeguy_24> Sounds like $subtract on dates returns difference in milliseconds? Can anyone confirm?
[02:55:34] <joannac> ryeguy_24: sounds right
[10:21:11] <user123321> If I install MonoDB in Ubuntu, and install PHP-MO-ADMIN later, would there be a conflict or will it already detect the existing Mongo DB and work with it?
[10:28:00] <Gr1> Hi everyone
[10:28:26] <Gr1> Is it possible for one primary node to act as the primary for multiple replica set clusters?
[10:28:54] <Gr1> like rs0 and rs1, that can share same primary node?
[10:59:24] <jikr> I have been searching for a way to append a string to the end of a field already containing a string, without having to retrieve the contents of that field first. But havent been able to find a good way to do it, so I went here for professional help :)
[12:01:16] <Yeitijem> Hi @ all! What is the best way to build a nested mongodb document from a nested object structure with casbah?
[12:01:39] <kali> Yeitijem: salat
[12:05:49] <Yeitijem> kali Ok Thanks!
[12:06:01] <mortah> Hi, we just upgraded to Mongo 2.6.1 in production and are seeing some weird issues
[12:06:21] <mortah> at best I can describe it as "stalling" every so often
[12:06:54] <mortah> looking at mongotop we have _nothing_ happening for about 30 seconds (or more) and then suddenly the total read goes up to 100s
[12:06:56] <kees_> like: 1-2 seconds every 30-60 seconds (but not always)?
[12:07:16] <mortah> a lot of it is in system.namespaces
[12:07:26] <mortah> then it goes back to normal for a bit..
[12:07:47] <kees_> if you run mongostat, do you see the lock% shoot up to 100% for 1-2 seconds?
[12:08:16] <mortah> during a hang thats not even outputting :P
[12:09:34] <mortah> but not long after it reports a high lock db
[12:09:41] <mortah> 3-4 readings after I mean
[12:09:55] <mortah> but not consistently reporting high lock
[12:13:22] <kees_> i guess i have other 'freeze' issues :)
[12:13:29] <mortah> :(
[12:14:03] <kees_> still not solved them tho.. just worked around it :/
[12:28:33] <mortah> Anyone know if it is possible to downgrade from mongo 2.6.1 to mongo 2.4.10?
[12:30:31] <kali> mortah: http://docs.mongodb.org/manual/release-notes/2.6-upgrade/#downgrade-limitations
[12:30:52] <mortah> ta
[12:32:09] <kali> mortah: and also that: http://docs.mongodb.org/manual/release-notes/2.6-downgrade/#downgrade-considerations
[12:32:56] <mortah> fortunately, hadn't got so far as to change auth stuff :P
[12:40:32] <mortah> downgrading back to 2.4.10 seems to have made it all good again
[12:40:34] <mortah> :(
[13:50:52] <pradeepc> Hello, I am trying to restore a replicaset of 3 machines out of which one if arbiteer.
[13:51:33] <pradeepc> now when i restored the data, i am getting an error saying "erplSet initial sync need a member to be primary or secondary to do our initial sync"
[13:51:47] <pradeepc> and both the nodes are in startup2 state
[13:52:48] <kali> what do you mean "restore" ?
[13:53:21] <kali> from a mongodump file, go back to a working replica set ?
[13:53:29] <pradeepc> I used the mongodump backup
[13:53:35] <kali> ok
[13:53:38] <pradeepc> kali: yes
[13:53:50] <kali> so what have you done so far ?
[13:54:27] <pradeepc> i restored the data on the node which i want to be primary using mongorestore command
[13:54:41] <pradeepc> and there is currently no data on the node whih i want to be secondary
[13:55:13] <kali> in what state where both servers when you added the data ? completely unaware of each other ?
[13:55:25] <kali> you started from a clean fresh install ?
[13:55:29] <mylord> can i have obj:{ “a”:1, “a”:2 } ?
[13:55:41] <kali> mylord: it may work, but it's a bad idea
[13:55:51] <kali> mylord: it will not work with all languages
[13:56:04] <kali> mylord: it really should not work at all.
[13:56:17] <mylord> how can i even do that tho, just curious? ie, how to get mongodb to add another “a” ?
[13:56:45] <mylord> i have a tournaments engine and user “a” can enter multiple times, but I guess I’ll make an array for his entrances
[13:56:51] <kali> mylord: i've seen it, but if i remember correctly it was due to bug in the ruby driver
[13:57:37] <kali> mylord: you could have an input hash with "a" as a string and :a as a symbol, so the hash was fine from a ruby point of view, and it was translated to a bson array with the key "a" twice present
[13:58:08] <kali> mylord: as mongodb was not doing any validation on the inserted document at that time, it was accepting it
[13:58:26] <kali> mylord: so... terrible idea :)
[13:58:34] <mylord> :)
[13:59:27] <tamm0r> hi
[14:00:09] <pradeepc> kali: http://pastie.org/9218793 This is the output of rs.status()
[14:00:48] <kali> pradeepc: i think you just need to call rs.init() on the server that you want as a primary
[14:00:56] <pradeepc> kali: I deleted the complete data and put the data back from mongodump
[14:01:59] <pradeepc> is by rs.init() you meant rs.initialize() ?
[14:02:07] <kali> yeah
[14:02:15] <kali> sorry
[14:02:28] <tamm0r> how do I set the nonAtomic flag for mapred in the Java driver?
[14:03:12] <tamm0r> couldn't find anything in the MapReduceCommand
[14:03:14] <pradeepc> kali: and then i need to rs.add() for each host ?
[14:03:44] <mylord> how can I add another “u1” here: “users”: { “u1”: [ { “score”:1 } ] }
[14:04:39] <pradeepc> kali: after doing rs.initialize() ,, now i got "try querying local.system.replset to see current configuration""
[14:04:52] <pradeepc> kali: "errmsg" : "already initialized"
[14:05:17] <kali> pradeepc: mmm... how did you "clean" the data exactly ?
[14:07:32] <kali> tamm0r: i can't see it either in the javadoc. you can probably workaround it by calling your map/reduce using DB.command
[14:07:42] <pradeepc> i did rm -rf mongo data directory
[14:08:41] <kali> pradeepc: ok, with the three servers stopped ? because the replica set configuration should have gone away too
[14:09:07] <pradeepc> kali: my arbiter was running
[14:09:18] <kali> pradeepc: bingo. you need to do it again
[14:09:51] <kali> pradeepc: stop the three of them, delete the data directories, start one and rs.initialize() it, import your data
[14:09:53] <pradeepc> kali: so basically i need to restore again
[14:09:58] <kali> pradeepc: then add the two others
[14:10:04] <pradeepc> nice nice
[14:10:12] <kali> pradeepc: yeah, your current state is too borken
[14:10:17] <pradeepc> so basically
[14:10:26] <pradeepc> i need to restore only on the one which i want to be primary
[14:10:30] <kali> yes
[14:10:46] <pradeepc> and then how should i start the one which i want to be arbiter
[14:10:58] <kali> clean its data directory
[14:11:15] <kali> start it, and call rs.addArbiter on the primary
[14:11:16] <pradeepc> ok
[14:11:21] <pradeepc> got it
[14:11:29] <pradeepc> thank you very much kali :)
[14:11:31] <kali> yeah, you need to clean data directories on three servers
[14:11:37] <pradeepc> kali: sure sure
[14:11:37] <kali> arbiter included
[14:11:48] <pradeepc> sure thank you very much :)
[14:12:30] <mylord> how can I add another “u1” to “users”? https://gist.github.com/anonymous/350d3abf12810028fb40
[14:12:32] <mylord> kali?
[14:13:40] <joannac> you can't?
[14:13:42] <tamm0r> kali: I think I'll subclass MapReduceCommand for now and submit a pull request for this and other extensions
[14:13:56] <joannac> you could add something to the u1 array, but not another u1 inside users
[14:14:27] <mylord> joannac: but i’m using an array.. i just want to push another object that inside has “ui”.. no collision
[14:14:52] <mylord> oops, i *meant* to make users an array
[14:15:12] <joannac> yeah, make users an array
[14:15:35] <joannac> just don't let it get too big
[14:17:41] <mylord> ok, fixed it
[14:17:42] <mylord> thx
[14:56:16] <mylord> how to update score of most recent joined user "u1"? https://gist.github.com/anonymous/6e62f1a963b4c316b3ab
[15:10:59] <mylord> how do I address an array element by index? ie, users[0] ?
[15:19:40] <qwebirc67965> hey all, quick question, do documents from different collections with the same shard key always end up on the same shard?
[15:23:14] <qwebirc67965> anyone around?
[15:23:54] <kali> qwebirc67965: nope. both chunking of collections and chunk migration are collection per collection
[15:47:13] <mylord> any help? how to update the score of one of the users, based on "uid" and "joined"? https://gist.github.com/anonymous/41f04d921554ecd3e07a
[17:01:48] <sshaginyan> Hi guys I have a problem getting a query to work. http://pastie.org/9219492
[17:02:14] <sshaginyan> I want to do an upsert.
[17:03:39] <sshaginyan> db.core.update({ domain: 'http://www.sbnation.com', 'technologies.name': 'jquery' }, { $push: { 'technologies.fit': obj } },{ upsert: true })
[17:07:00] <sshaginyan> guys?
[17:33:06] <mzarella> Will someone take a look at me trying to get this basic db session started? https://pastee.org/e36an
[17:33:53] <mzarella> My quest is when you do: new mongodb.Server(), do you need to specify a host and port?
[17:34:01] <mzarella> If so, what is the recommended method?
[17:34:19] <mzarella> Do you just use something like "localhost" and the default port mongo is running on?
[17:40:40] <mzarella> localhost and the port mongo is running on seems to work just fine
[17:46:14] <foo> I'm coming to MongoDB from MySQL. Any suggested guides on wrapping my head around the differences?
[17:46:45] <YuviPanda> I'm setting up a mongo install for wikimedia.a let's see how this goes :)
[17:46:57] <foo> YuviPanda: May the force be with you. :)
[17:47:08] <YuviPanda> foo: :) ty
[17:47:52] <YuviPanda> I've to fully puppetize it as well. should be fun
[18:54:21] <mzarella> I have a module that has exports a few functions, those functions need to talk to an open connection to mongo
[18:54:35] <mzarella> How do I initialize the session?
[18:55:34] <mzarella> I want something like:
[18:55:39] <mzarella> foo = module.exports = exports
[18:55:52] <mzarella> foo.bar = function() { /* something */}
[18:55:58] <mzarella> where something is talking to the db
[18:56:14] <mzarella> I can't wrap all the functions in a callback where I'm connecting to mongo
[18:57:05] <mzarella> I need an open session that I can call from within the functions
[18:57:17] <mzarella> mongodb = require('mongodb');
[18:57:37] <mzarella> dbServer = new mongodb.Server("localhost", 28017);
[18:58:02] <mzarella> db = new mongodb.Db("test", dbServer, { auto_reconnect: true});
[18:58:14] <mzarella> db = db.open()
[18:58:24] <mzarella> that last line should be invalid, but I want something like this
[18:58:48] <mzarella> so that I can reference the db session from within the functions that are being exported by the module
[19:19:47] <mzarella> http://www.reddit.com/r/mongodb/comments/26ji9u/how_to_get_a_handle_on_an_open_connection_without/
[19:47:36] <tpayne> Hello. Is there a way to have mongo treat multiple collections as one? For pagination reasons. For example I'm building a feed of different types. I'm trying to refrain from having hybrid data objects that satisfy more than one type, and is identified by some integer...
[21:18:46] <jimpop> what's the correct pymongo syntax to find all documents with an _id that matches $in a python list?
[21:19:02] <jimpop> i tried: ids = list(testdb.find({ '$text': { '$search': 'superman'}})
[21:19:07] <jimpop> tot = testdb.find( { '_id': { '$in': ids}}).count()