PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 13th of August, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:40:52] <wsayo> is there such a thing as mongoDB 2.6 for debian on armhf?
[02:41:09] <wsayo> closest i've found is 2.4
[05:57:33] <aps> Is Ops Manager a paid service or can I install it on my infrastructure?
[06:16:36] <Boomtime> aps: the download of ops manager is for 'evaluation' only and wants contact info to talk to a sales rep, so no it's a paid product
[06:18:03] <mbuf> when I restore a replica set into a new node, I still see the old members when I do rs.conf(), even though when I start the new instance with a different replica set name in /etc/mongod.conf. How can I remove the old members with force?
[06:24:00] <joannac> mbuf: starting a new replica set?
[06:24:25] <mbuf> joannac: yes
[06:24:33] <mbuf> joannac: from snapshot backup
[06:24:41] <joannac> mbuf: stop the node, remove local.* from the dbpath, and then start and initiate
[06:24:52] <mbuf> joannac: I am able to launch three new instances, and start the mongod; okay
[06:26:05] <joannac> mbuf: http://docs.mongodb.org/manual/tutorial/restore-replica-set-from-backup/
[06:35:26] <mbuf> joannac: that worked! thanks!
[06:35:49] <mbuf> joannac: you have saved my day, twice
[07:46:25] <aps> How much does ops manager cost? My main use-case is taking backups
[07:48:27] <aps> How much does ops manager cost? My main use-case is taking backups.
[07:48:48] <joannac> aps: I can almost guarantee it's not cheaper than Cloud Manager backups
[07:49:12] <joannac> aps: (if I'm remembering the right conversation we had)
[07:49:35] <aps> How much does ops manager cost? My main use-case is taking backups.
[08:31:18] <aps> sorry for repeated messages, there was a network delay
[08:32:19] <aps> joannac: Even if I host it on my own infrastructure?
[10:43:55] <NoReflex> hello! I have some slow queries so I added a new index to make them faster. Up until now the query used a large index (1.2 GB) so I added a new sparse index (47 MB).
[10:44:36] <NoReflex> I can contruct my query so that it uses one index or another but the query runs just as slow
[10:45:06] <NoReflex> I'm suspecting the new index is not being used so I checked the logs
[10:45:36] <NoReflex> so in the log I can see planSummary: IXSCAN { xti: 1.0, xrt: 1.0 } - this is the new index
[10:45:58] <NoReflex> and planSummary: IXSCAN { ti: 1, mo: 1 } (this is the old index)
[10:46:19] <NoReflex> notice the 1.0, 1.0 VS 1, 1
[10:46:32] <NoReflex> can this mean the new index is not being actually used?
[10:50:29] <NoReflex> I
[10:52:26] <NoReflex> I'm using MongoDB 3.0.5 on Arch, WT with snappy on a notebook with i7 3517U CPU, 10 GB RAM, HDD 750 GB and the database size reported by show dbs is 10 GB
[11:10:36] <NoReflex> anyone?
[14:17:34] <xcesariox> can someone help me out, i have an error https://eval.in/416371
[14:20:10] <odigem> hi
[14:20:31] <cheeser> xcesariox: is that meant to be a function definition or an invokation?
[14:20:52] <xcesariox> cheeser: which line? lINE:17 ???
[14:21:05] <cheeser> yeah
[14:21:36] <xcesariox> cheeser: is suppose to be the same as LINE: 47
[14:21:59] <xcesariox> cheeser: line 47 seems fine. but why line 17 shows an error that i am not defining it?
[14:22:31] <cheeser> comment out line 17. i'll bet it complains about 47.
[14:23:46] <odigem> mongo can find elements matchs for any key in array?
[14:29:06] <xcesariox> cheeser: i accidentally dC.
[14:29:17] <xcesariox> cheeser: yeah it shows error for line 47 too.
[14:29:25] <cheeser> i figured. :D
[14:29:28] <xcesariox> cheeser: how do i fix this?
[14:38:19] <xcesariox> cheeser: okay i added the function but now it prompts this error https://eval.in/416381
[14:39:04] <hypfer> hello, I have a simple aggregate group query and I'd like to multiply the average value by 8760 and then divide it by 1000. here's the current query: http://paste.debian.net/291966/
[14:39:25] <cheeser> xcesariox: yeah, that's a bit beyond my js knowledge...
[14:40:04] <cheeser> xcesariox: i'm pretty sure you can't define a function as a function declaration parameter. you can *invoke* a function that that, though.
[14:50:42] <xcesariox> cheeser: https://gist.github.com/shaunstanislaus/ca39ed89cd5a8d24e28f
[14:50:55] <xcesariox> cheeser: i copied the whole function so that you know what i was trying to do.
[14:51:02] <xcesariox> cheeser: i did define those stuff else where.
[15:11:06] <bogen-work> I'm trying to use amid-rest. I'm able to query and get. When I post a new document is created, but the supplied json string, while not reject by the request is ignored. amid-rest returns the location (an empty document apart from the assigned _id) and waits for the next request.
[15:11:17] <bogen-work> I'll provide a link shortly to a paste of what I'm sending
[15:23:41] <bogen-work> http://pastebin.ca/3102416
[15:30:25] <bogen-work> for PUT/db/collection/id the document is also ignored
[15:34:40] <bogen-work> ok, got POST's working.... (I had application-json rather than application/json for Content-Type)
[15:35:44] <bogen-work> and PUTs work too..
[17:25:39] <gcfhvjbkn> test
[17:25:54] <gcfhvjbkn> i've got a question about java-mongo-driver
[17:26:20] <gcfhvjbkn> i've created a server-side function by populating the system.js table as described here
[17:26:20] <cheeser> about serializing a BsonDocument to bson?
[17:26:20] <gcfhvjbkn> http://docs.mongodb.org/v2.6/tutorial/store-javascript-function-on-server/
[17:27:03] <gcfhvjbkn> cheeser: i've semi-solved that one, but yeah i'd love to know of a standard way to do that
[17:27:13] <cheeser> BsonWriter
[17:27:40] <gcfhvjbkn> now i can access the function in the mongo shell after invoking db.loadServerScripts();
[17:28:01] <gcfhvjbkn> my question is, how do i invoke it as part of a query?
[17:28:13] <gcfhvjbkn> i do this: new BasicDBObject("_id", new Code("getNextSequence('userid')")).append("rawUserId", rawUserId)
[17:28:26] <gcfhvjbkn> and it seems to insert "getNextSequence('userid')" as a code object without invoking it
[17:29:59] <gcfhvjbkn> cheeser: so that's the best way then? what about de-serialization?
[17:30:02] <gcfhvjbkn> http://pastie.org/private/gry5se0kuynxndralibba
[17:31:03] <gcfhvjbkn> this is my take, which doesn't work to well because i have to "case" every json type manually and even then you need to serialize Arrays and Documents in a special manner
[17:31:36] <gcfhvjbkn> you'd think the api will provide a method that builds the whole document tree for you
[17:37:35] <lufi> hi, is there something wrong with my query? http://pastebin.com/dybHbT8Z .I am getting an "invalid operator $dateToString" error
[17:46:46] <cheeser> lufi: are you on 3.0?
[17:56:22] <deathanchor> any know of code/query to find dups so I can build a unique compound index?
[18:02:35] <deathanchor> found something http://blog.mongolab.com/2014/03/finding-duplicate-keys-with-the-mongodb-aggregation-framework/
[18:51:32] <lucha> Hello there!
[18:51:54] <lucha> Is there a way to generate a many to many rellationship between two collections in mongoose?
[19:17:03] <Pinkamena_D> I am trying to store a field in a document which contains a type of mapping from filenames to file hashes. The majority of queries will be giving the file name of one file and wanting back a mapping of all filenames to file hashes in that document. Because I can not use filenames as the keys directly, what is the best way to store this data?
[19:17:47] <Pinkamena_D> I can think of many possibilities, such as using an array of documents, or using two parallel arrays.
[19:18:08] <Pinkamena_D> But any suggestions from experienced people?]
[19:40:23] <gcfhvjbkn> ok, another try: how do you represent this structure with java-mongo-driver?
[19:40:24] <gcfhvjbkn> http://pastie.org/private/bkxxotb5xnxch02zyxbzq
[19:40:34] <gcfhvjbkn> in particular, "getNextSequence("userid")"
[19:41:16] <gcfhvjbkn> i tried bson.types.Code and bson.BsonJavaScript, but they do a different thing:
[19:41:55] <gcfhvjbkn> the code i sent gets evaluated when i type db.users.find() in mongo, not at the moment when the data is saved
[19:42:08] <gcfhvjbkn> any ideas?
[19:42:31] <gcfhvjbkn> i suppose it might not be one of the bson.types._ classes because in this use case nothing needs to be stored on disk
[19:44:41] <joannac> create the getNextSequence function in java
[19:44:57] <cheeser> i don't think you can via java. executing serverside javascript isn't a big priority for the java driver.
[19:45:14] <cheeser> in fact, i think server side javascript is generally discouraged anyway
[19:45:19] <joannac> cheeser: it's just a findandmodify call though
[19:45:20] <happiness_color> you could write a function and use $inc inside....
[19:45:52] <joannac> I agree with the "discouraged", but FaM isn't deprecated... yet
[19:45:57] <gcfhvjbkn> really? i need this feature badly; any workarounds?
[19:46:28] <gcfhvjbkn> can't really rewrite it in java, i want to rely on it to be run on the server-side
[19:46:45] <gcfhvjbkn> happiness_color: can you elaborate just a little bit?
[19:49:03] <cheeser> joannac: sure. but it's exec'd as serverside js which is a code smell to me.
[19:53:05] <happiness_color> getNextSequence("userid") { collection.findAndModify(query, new BasicDBObject("$inc", new BaseciDBObject("_id", 1));
[19:54:25] <happiness_color> well not _id but seq..
[19:54:35] <happiness_color> basically the getNextSequence in mongo, is a $inc
[19:54:43] <happiness_color> http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/
[19:55:46] <happiness_color> you could translate it into java right as-is...or?..
[19:56:10] <gcfhvjbkn> happiness_color: that's not atomic for the server anymore, is it?
[19:56:35] <happiness_color> $inc is for sure...
[19:56:56] <gcfhvjbkn> what happens if two clients try to increment the same key simultaneously? i wager one will get an exception on insert
[19:58:26] <cheeser> gcfhvjbkn: findAndModify is atomic.
[19:58:44] <happiness_color> if you say findAndModify and do $inc for the field, that should be atomic
[20:01:35] <gcfhvjbkn> yeah, that will work indeed, you are right
[20:01:59] <gcfhvjbkn> thanks! i didn't give it enough thought
[20:42:58] <jpfarias> hey guys
[20:43:11] <jpfarias> is there a way to speed up $all queries on a field that is already indexed?
[20:43:17] <jpfarias> the field is an array of strings
[21:02:13] <happiness_color> keep another (indexed) field with concatenated values?.. :/ nothing better comes to mind
[21:44:33] <Petazz> This is somewhat offtopic to this channel but
[21:44:41] <Petazz> So I just set mongoengine to use replicasets by setting a keyword arg replicaSet="rs0", so far so good. Then I tried going into the primary and calling rs.stepDown() so a new primary was elected
[21:44:46] <Petazz> This caused all to go haywire :/
[21:44:49] <Petazz> First it gave me a pymongo.errors:AutoReconnect: connection closed
[21:44:52] <Petazz> I guess that is expected
[21:44:56] <Petazz> Then it kept giving me pymongo.errors:AutoReconnect: not master and slaveOk=false
[21:44:59] <Petazz> Shouldn't the MongoReplicaSetClient automatically reconnect to the primary?
[22:14:39] <joannac> Petazz: it should. all the official drivers do, to my knowledge