PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 4th of July, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:13:24] <multi_io_> when you're performing an update the includes an $inc operation, is there a way to find out the new value of the incremented field without performing an additional query?
[01:13:42] <multi_io_> *when you're performing an update that includes an $inc operation, is there a way to find out the new value of the incremented field without performing an additional query?
[01:18:43] <multi_io_> I mean a findAndModify
[01:18:55] <multi_io_> found the "new" option, will try that
[01:36:07] <awpti> I could use some help here -- I feel I'm fundamentally misunderstanding something, but I'll be damned if I can work out what that is: http://pastie.org/8107912 (question is in the pastie with relevant data)
[01:56:25] <pplcf> is it ok to save _id as simple int, not ObjectId(my int)?
[02:50:40] <dyu> we currently have 1.8.1 in production. is it advisable to update it to the latest stable version(2.4.5)?
[02:51:36] <awpti> As long as you have a test env in place to ensure functionality, why would you not update?
[02:54:28] <dyu> uhm. managers? haha. kidding(slightly). i'd just like to know if there are any things to look out for during the update. i'm also not sure if the tests are that mature already. there's no one in the office that i can ask right now
[02:55:30] <mgaogw> Hey guys, quick question regarding post methods. After a form is submitted and the post is requested, how does the info from the form get stored in the receiving server - i.e. how do i access it again to save in mongo?
[02:56:18] <awpti> mgaogw, pick a programming language, learn it. :>
[02:57:44] <mgaogw> i guess i'm really asking how post itself works
[03:16:45] <oklada> Anyone felt like mongoose (ODM for mongodb) has drawbacks because it enforces schemas? is it better just to go with the native driver?
[04:26:00] <thesheff17> is anyone working with mongodb and raspberrypi...I see a couple git repos but they are lacking behind on versions
[05:39:31] <neeky> oklada - Thats a large part of the purpose of an ODM -
[05:39:49] <neeky> if you don't want a schema, don't use an ORM
[09:23:01] <mjburgess> anyone know much about the C driver? i'm wondering how i can construct { "x": [ {"name": "michael"}, {"name": "michael"}, ...] }
[09:23:21] <mjburgess> it seems the inner objects are essentailly annoymous but the api always requires a attribute name
[12:30:13] <Beg_> is it possible to make a non-aggregated sort by custom strings? I have a system of approved, rejected, pending. and would like to sort by pending first
[12:42:45] <Nodex> in a query?
[13:19:33] <sdfghjhgffd> hi
[13:19:55] <sdfghjhgffd> i've encountered this error while attempting to create unique compound index
[13:20:06] <sdfghjhgffd> too may dups on index build with dropDups=true
[13:20:23] <sdfghjhgffd> of course I've stumbled upon this discussion
[13:20:25] <sdfghjhgffd> https://groups.google.com/forum/#!topic/mongodb-user/OG637jkxKdQ
[13:21:13] <sdfghjhgffd> where it is advised to make sure there is less than certain number of unique entries
[13:21:25] <sdfghjhgffd> the number is said to be one million
[13:21:42] <sdfghjhgffd> but i don't have million of dupblicates
[13:22:04] <sdfghjhgffd> the highest number of duplicates i've got is circa 60 000
[13:22:54] <sdfghjhgffd> so the question arises: which is the actual limit of duplicates number, under which ensureIndex works with dropDups
[13:23:32] <sdfghjhgffd> i suck at wording, but i hope it's at least understandable
[13:23:44] <kali> it's understandable
[14:35:32] <dandre> hello
[14:35:45] <dandre> please see: http://pastebin.fr/27907
[14:36:34] <Nodex> k2.kk1
[14:36:48] <Nodex> !google MongoDB Dot Nottion
[14:36:49] <pmxbot> http://docs.mongodb.org/manual/reference/glossary - Glossary — MongoDB Manual 2.4.4
[14:36:57] <Nodex> !google MongoDB Dot Notation
[14:36:57] <pmxbot> http://docs.mongodb.org/manual/core/document - BSON Documents — MongoDB Manual 2.4.4
[14:37:04] <Nodex> bleh
[14:39:35] <dandre> ok thanks
[15:30:23] <Kosch> As far as I read, the replication configuration usually demands the master connects the slave and the slave connects the master. Is it possible to have a slave which has not direct access to the master?
[15:31:21] <Kosch> I'm looking for something where the master just pushed the changes to the slave.
[15:33:16] <Nodex> a replicaset can be part of a shard, not sure if it has to connect to the master or not though
[15:33:36] <Nodex> or whether just connecting to it's shard is enough
[15:36:51] <Kosch> hm.
[15:46:53] <Kosch> well, replset is different than the old master-slave stuff
[15:48:13] <Kosch> as I see for the master-slave stuff connection from slave -> master is needed. with repl-set I need master<->slave.
[15:54:40] <double_p> Kosch: in a replset you need working dns/communication between all nodes. no matter what prim/sec state they've the given minute
[15:56:37] <double_p> well, not really dns. but consistency in ip/hostname
[16:35:38] <davidbrai> hi
[16:35:56] <davidbrai> I'm running a db repair and got an error "You must use a --repairpath that is a subdirectory of --dbpath when using journaling"
[16:36:02] <davidbrai> any idea why is that needed?
[16:36:24] <davidbrai> I'm using repairpath because I don't have enough available space on the same volume
[16:58:08] <DArthVader> hey davidbrai
[16:58:36] <DArthVader> ping davidbrai you probably don't have enough resources on the server you are running mongodb on
[16:59:01] <DArthVader> I had a similar problem
[16:59:12] <DArthVader> I was using amazon EC2 small instance
[16:59:30] <DArthVader> run mongod
[16:59:36] <DArthVader> and tell me what happens
[16:59:37] <DArthVader> ?
[17:35:48] <awpti> I could use some help here -- I feel I'm fundamentally misunderstanding something, but I'll be damned if I can work out what that is: http://pastie.org/8107912 (question is in the pastie with relevant data)
[17:37:12] <awpti> This same thing happens even if I toss the $and, and only do a .find( { visitguid_1: ###### } ), it still returns all records in the table.
[17:40:14] <Nodex> what are you trying to achiebe?
[17:40:17] <Nodex> achieve?
[17:40:58] <awpti> Just to get a single record that matches a given value. As far as I've been able to understand, doing a .find( { field:val } ) should return only the item(s) that match that value.
[17:41:13] <Nodex> does that record contain both the fields?
[17:41:24] <Nodex> ie... foo : 1, bar: 2
[17:41:47] <awpti> Yes. I search for values that don't exist and it still returns a record.
[17:42:29] <Nodex> if your document looks like this .... {foo:1, bar:2.......} ... you can search for it like this.... db.foo.find({foo:1, bar:2});
[17:42:43] <Nodex> BOTH the criteria have to be met for it to return
[17:42:57] <awpti> Which I've done. I've searched for values that don't exist and it still returns that single record.
[17:43:02] <awpti> that's what's killing me.
[17:43:44] <awpti> { "_id" : ObjectId("51d4837fac5b631d78d799e0"), "visitguid_1" : 4316825677377845000, "visitguid_2" : 9745372576957034000, } <--that's the single record that exists. even if I do a .find( { visitguid_1: 1234 } );, it returns that record.
[17:44:08] <Nodex> even in the shell?
[17:44:50] <Zelest> haha, i read "evening in the shell" and was about to say evening to you too :D
[17:44:55] <Nodex> lmao
[17:45:02] <Nodex> I am not a snail :P
[17:45:07] <Nodex> (gasrtopod)
[17:45:10] <Zelest> :D
[17:45:15] <Nodex> gastropod*
[17:45:15] <Zelest> how's things? ;)
[17:45:20] <Nodex> not bad mate, you?
[17:45:29] <awpti> Nodex, yes -- in the shell. Only place I've been working so far. I just started with mongo a few days ago.
[17:45:31] <Zelest> all good all good.. on vacation atm :D
[17:45:42] <Nodex> awpti : which mongo version?
[17:45:50] <Nodex> vacation and you're on IRC ?
[17:45:50] <awpti> 2.4.4 at the moment.
[17:45:53] <Nodex> are you mad LOL
[17:46:16] <Zelest> Nodex, at the ladys place :)
[17:46:20] <Nodex> awpti : the only thing I can think is it's getting confused with 64bit int's
[17:46:35] <Zelest> slacking in her bed while she's knitting :P
[17:46:44] <Nodex> haha
[17:47:15] <awpti> That sounds like it might be a bug. I'm going to fiddle a bit more, but I can't see anything that I'm doing wrong offhand.
[17:47:29] <Nodex> awpti : give it a restart
[17:47:39] <Nodex> and try on a different collection with lower numbers
[17:48:48] <Nodex> my cat is going absoutely mad at my music, running round my office like a mad man
[20:32:32] <tijmen> Hi, I'm looking for a doc with instructions or possible issues when upgrading from mongo 2.0.4 to 2.4.5
[20:32:55] <tijmen> I can just add this to my sources.list http://downloads-distro.mongodb.org/repo/ubuntu-upstart
[20:33:00] <tijmen> and do apt upgrade
[20:33:09] <tijmen> but perhaps I break something
[20:36:33] <kali> tijmen: if you use sharding, you definitely need to go through 2.2
[20:37:45] <tijmen> I don't
[20:37:49] <kali> tijmen: there are a few other restrictions, check that out: http://docs.mongodb.org/manual/release-notes/2.4-upgrade/
[20:38:20] <tijmen> I don't have auth, only localhost
[20:38:32] <tijmen> and sharding is when you run multiple mongo instances right?
[20:38:47] <awpti> Ugh, it's still happening.
[20:39:08] <kali> tijmen: if you have one single instance, you're not using sharding.
[20:39:14] <kali> tijmen
[20:39:31] <tijmen> thanks, just checking :)
[20:39:44] <awpti> I'm running db.events.find( { visitguid_1: 4316825677377845000, visitguid_2: 9745372576957034001 } ) --- the value from visitguid_2 does not exist, yet this query returns a document. What the hell am I missing here? This is an implicit AND, as far as I understand.
[20:40:30] <kali> awpti: show us how you run the command and whan mongodb returns, please
[20:41:10] <awpti> http://pastie.org/8110909
[20:41:17] <kali> too big numbers
[20:41:57] <awpti> How do i deal with this, then? My application uses numbers like this everywhere. Should I just treat them as strings instead of integers?
[20:42:14] <kali> yeah, that's an option
[20:43:29] <awpti> Hrm.
[20:43:39] <kali> biggest signed 64bit is 9,223,372,036,854,775,807
[20:43:46] <kali> you're above
[20:44:31] <awpti> I take it there's no equivalent to an unsigned integer?
[20:45:07] <kali> http://bsonspec.org/#/specification
[20:45:08] <kali> nope
[20:45:25] <awpti> String it is, then :>
[20:45:28] <kali> but you can wrap it in an object id
[20:48:37] <awpti> Huh, even as a string it does it.
[20:49:23] <kali> show me
[20:51:38] <awpti> I assume this saves it as a string, or does mongo assume "string of numbers == int"? db.events.save( { visitguid_1: "4316825677377845000", visitguid_2: "9745372576957034001" } );
[20:52:56] <awpti> I should just have the dev find a better way to reference records. :>
[20:52:58] <kali> nope, it saves as a string, no monkey business here
[20:53:18] <kali> this is not visual basic
[20:54:18] <awpti> Ugh, I'm an idiot. Nevermind.
[20:54:30] <awpti> I saved it with the invalid value this time. :>
[20:55:01] <kali> ok :)
[20:55:05] <awpti> Now it works as expected. So, note to self: Store these as strings or get dev to find a better way to do it.
[20:55:46] <kali> objectid or binary would be better in term of storage
[20:56:22] <awpti> I'll have to read up more on those. Gotta wait until the 15tg for the next 10gen class, so I'm running somewhat blind and coming from a pure SQL background.
[20:56:35] <kali> or if you're sure what you have is 64 unsigned integer, substract 2^64 to be bigger half to get them back in the "right" range
[22:10:50] <loconut> hello- I'm trying to get started with mongodb on the right foot. What's the correct/best interface to mongodb from Node.JS- is it Mongoose (npm install mongoose), MongoDB (npm install mongodb), something else? I plan to use/need GridFS as well. Does that change the answer?
[22:14:33] <loconut> or do I need both?
[22:37:59] <drag> Hi there. Is there a way I can insert/upsert a new document and have the id of the document returned?
[22:39:19] <drag> Or can I get mongodb to assign a new _id value that it generates before I insert?