PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 1st of September, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:14:25] <fitzagard> Is there a specific way to declare a data type when doing a csv import with mongoimport?
[00:19:25] <crudson> fitzagard: it will guess simple things like ints, but I don't think there's any explicit way to specify. Best off importing json.
[00:19:56] <fitzagard> crudson: I was afraid of that :)
[00:20:45] <fitzagard> crudson: thanks. I was hoping I could at least get a MongoId pulled in (no an _id replacement)
[00:23:39] <crudson> fitzagard: strings and ints, that's about all you can expect
[00:23:53] <fitzagard> crudson: okay
[00:24:53] <crudson> maybe some bools or something, but for anything except the simplest examples, you need to use json, or save the documents directly without mongoimport
[00:53:41] <runT1ME> can someone help me with a query for a nested element?
[01:11:41] <crudson> create a paste and if someone can help you they will
[01:24:53] <runT1ME> http://pastie.org/4643322
[01:25:11] <runT1ME> I'm looking for a way to retrieve the user that has a contact with phone number [x]
[01:42:13] <phira> runT1ME: still need an answer to that?
[01:42:24] <runT1ME> yeah that would be great, thanks
[01:46:39] <phira> db.users.find({"contacts.phonenumbers.cell": '5554443333'})
[01:46:47] <phira> runT1ME: that should do it, I think
[01:47:02] <runT1ME> ah. but I don't know if it's under cell
[01:47:04] <phira> keep in mind that this will give you the whole user record as a result, so long as at least one of the cell numbers is that value
[01:47:08] <runT1ME> I need a wildcard for that
[01:47:19] <phira> you mean it could be cell, or home?
[01:47:34] <runT1ME> does that make sense?
[01:47:39] <runT1ME> yes
[01:48:00] <runT1ME> or an arbitrary designation
[01:49:04] <phira> hrm
[01:49:13] <phira> I'm less certain about that
[01:50:24] <runT1ME> yeah.. I don't even know if it's possible?
[01:51:02] <phira> I mean
[01:51:04] <phira> for simple terms
[01:51:12] <phira> you could just do a set of $or
[01:51:18] <phira> in order to test cell, home, work
[01:51:27] <phira> but I don't think there's an arbitrary one, short of doing a mapreduce
[01:52:03] <runT1ME> there isn't a wildcard or something
[01:52:15] <phira> not that I'm aware of, but I'm by no means an expert
[01:53:09] <runT1ME> oh. what if I changed my contacts from being a 'map' to an array of maps
[01:54:33] <phira> yeah, that'd work
[01:54:54] <phira> phonenumbers: [ {type: cell, number: 5554443333}, {type: home, number: 44334334}]
[01:55:17] <phira> then you can just do contacts.phonenumbers.number
[01:55:44] <phira> I think, anyway. you might want to check.
[01:56:48] <runT1ME> hrm. but how would I query on it then, wiht a wildcard?
[01:57:07] <phira> er
[01:57:10] <phira> not sure what you mean?
[09:16:25] <NodeX> removing 53M docs from a collection is SLOOWWWWW
[09:34:37] <Gargoyle> \o/ I found my memory leak!
[09:36:02] <Gargoyle> Creating a new connection inside a loop of 300,000+ items is not good.
[09:36:17] <Gargoyle> It's now a static var :)
[10:01:18] <NodeX> anyone noticed increased ram usage in 2.2?
[10:05:29] <Neptu> hej how i can have more than 1 bind_ip??
[10:15:11] <NodeX> I think someone else did bind to 0.0.0.0 before
[10:27:00] <algernon> Neptu: bind_ip=1.2.3.4,4.5.6.7,localhost,etc
[10:34:04] <NodeX> good to know ;)
[14:15:30] <fission6> i am trying to start mongo but it keeps saying my dbpath doesn't exist
[14:15:54] <fission6> which makes sense since it doesn't /data/db/ but i have no idea what it is
[14:22:38] <fission6> weird it doesn;t seem to be using the settings i have in mongodb.conf
[14:30:38] <NodeX> make sure the init.d file is reading the correct config file
[14:34:10] <NodeX> site RElaunched : http://www.theukjobsite.co.uk/ ... massive thanks to 10gen for a great product and getting 2.2 out in time for the launch. Full Mongo based job board on a fully mongo based CMS
[14:51:48] <Neptu> hej Im using python driver and I have to insert 97000 json in a batch anyone knows if i should do it with save?
[14:56:03] <NodeX> save is a helper for upsert() in reality ... not sure if it's the same in python but i would guess it is
[15:07:07] <Neptu> "object does not support item assignment" do you know what causes this error?
[15:54:07] <Gargoyle> MongoDB can't count! Results of looping over a cursor altering the items:- 591920 of 314526
[15:55:12] <Gargoyle> db.reviews.find().count() = 314529
[16:03:41] <Neptu> Sat Sep 1 16:02:23 out of memory shell/query.js:122 im getting this message out of a find().length()
[16:03:53] <Neptu> how can i give the db more memory?
[16:05:06] <Gargoyle> Neptu: What's find().length() ?
[16:05:23] <Neptu> db.collection.find().length();
[16:06:15] <Neptu> Gargoyle: should a change something on the conf file?
[16:06:42] <Gargoyle> Oh. length() is the same as count() ?
[16:07:06] <Gargoyle> Not sure you can. Just whatever is available on your system I think?
[16:07:24] <Neptu> Gargoyle: conna try count
[16:08:07] <Neptu> length should be something different count works fine for me
[16:09:18] <Gargoyle> I don't remember seeing length() in the docs - but I suppose it is a native JS method
[16:11:24] <kali> Neptu: Gargoyle: http://uu.zoy.org/v/dijo#clef=xzqjqmepisasagam
[16:11:25] <Neptu> Gargoyle: yep it came natural for me write length not count...
[16:34:01] <bizzle> What do you guys think about ORMs? I was gonna try using one for my next project, but I don't really see the benefit
[16:34:34] <bizzle> it saves you some boiler plate at the start, but if you care about the project scaling, it seems like they would be a huge inhibitor, and they are less flexible
[16:35:37] <ppetermann> not getting your question. mongodb is not relational so what you want with object relational mapping?
[16:36:32] <bizzle> haha, good point. What do you call them with mongodb then?
[16:37:05] <bizzle> whatever the layer is that maps DBObjects your native objects
[16:37:14] <kali> ODM
[16:37:18] <kali> for document
[16:37:55] <bizzle> Do you guys find that they are a good choice for projects where you intend to scale?
[16:37:57] <ppetermann> well thats a few very basic classes in my case which doesnt add much to it, since most of an object can be stored into mongo anyways
[16:38:18] <ppetermann> to me document = object, sort of
[16:38:41] <ppetermann> so yes its definately worth it
[16:38:59] <bizzle> thats kindof what I was thinking. Your benefit was much greater with sql
[16:39:12] <bizzle> you say its definitely worth it to use the driver?
[16:39:13] <ppetermann> and if only because i prefer $object->save(); over $databasestuff->save($object)
[16:39:17] <kali> bizzle: i don't see the scalability issue with odms
[16:39:40] <kali> bizzle: and if you try to do mongo with a statically typed language without odm, you will feel your pain
[16:43:12] <bizzle> But what about optimizing your queries and stuff?
[16:43:20] <bizzle> I am using scala
[16:46:24] <kali> bizzle: have a look at salat, then
[16:46:44] <kali> bizzle: il will save you a lot of ugly asInstanceOf[] or getAs[]
[16:46:52] <bizzle> Yeah, i have been, but I am worried about flexibility
[16:47:17] <kali> bizzle: it just handles the dbobject - case class mapping
[16:47:26] <kali> bizzle: not trying to write queries for you
[16:47:46] <kali> bizzle: and you don't have to use it all the time
[16:48:40] <bizzle> But if you just want to recieve a small subset of info, then you need everything to be in Options right?
[16:48:52] <bizzle> like all your constructor arguments
[16:50:28] <kali> bizzle: well, you can define an ad-hoc case class for a given situation if you like, as it's so easy (not very dry, but not worse than having docuemnt key all over the place)
[16:50:45] <kali> bizzle: option are for optional properties
[16:55:04] <bizzle> what kind of projects have you used salat on?
[16:55:11] <bizzle> kali
[16:56:44] <kali> bizzle: small and fast webservices
[16:57:05] <kali> bizzle: using unfiltered
[16:57:21] <bizzle> gothcya, what was your biggest complaint?
[16:57:34] <bizzle> sorry, i am like berating you with questions, haha
[16:57:50] <bizzle> I really appreciate you helping me :)
[16:57:59] <kali> complaints about what ? :)
[16:58:14] <bizzle> haha, about salat, no complains?
[16:59:11] <kali> not much, realy. one big limitation is the fact case class are limited to 21 fields (but this is scala limitation, not a salat limitation)
[16:59:23] <kali> i have one instance of a document where it is an issue
[16:59:39] <kali> so i use partial mappings
[17:00:10] <kali> but realy, salat is so unobstrusive... where it fits, it helps a lot, where it does not fit, i don't use it.
[17:01:16] <bizzle> kali, where does it not fit?
[17:03:40] <kali> bizzle: when what you store is hash, not a business object: the app has no knowledge of the keys
[17:03:45] <kali> bizzle: but it's rare
[17:04:30] <bizzle> hmm, I see
[17:04:58] <bizzle> I guess I will just continue with it
[17:05:06] <bizzle> thanks so much for your help, I really appreciate it
[21:58:43] <andywdc> hey guys
[21:58:48] <andywdc> i am creating a users collection
[21:58:54] <andywdc> and only want unique users to be entered
[21:58:57] <andywdc> how can this be done?
[22:08:41] <andywdc> anyone/
[22:08:41] <andywdc> ?
[22:09:40] <wereHamster> andywdc: unique how
[22:10:12] <andywdc> maybe specify the specific ID
[22:10:18] <andywdc> i think i can just add a field _id right?
[22:10:25] <andywdc> and it will override the mongodb default
[22:10:40] <wereHamster> _id is added to all documents automatically
[22:10:52] <andywdc> yeah but i can override it right?
[22:10:56] <wereHamster> with what
[22:10:59] <andywdc> my own id
[22:11:04] <wereHamster> sure. whatever.
[23:08:48] <sinisa> hi all
[23:09:18] <sinisa> anyone knows how to make TTL collection with db.runCommand ?
[23:17:09] <_xo__> hi
[23:19:13] <sinisa> anyone knows how to make TTL collection with db.runCommand ?
[23:40:39] <_xo__> I wonder why this pice of code ( http://pastebin.com/Jc8AWtRq ) cant update a document in mongo
[23:41:00] <_xo__> it works fine with hardcoded values in the cli