PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 3rd of November, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:52:15] <frive_> hi, is there a way to use env variables in a mongodb config file?
[06:19:41] <fg3> how to display a document with the properties sorted?
[13:18:01] <svnindia> how to monitor mongodb based on its action (query,insert,update) ?
[13:25:58] <svnindia> how to monitor mongodb based on its action ?
[13:42:19] <cheeser> svnindia: tail the oplog
[13:42:39] <svnindia> will try... thx
[13:42:52] <svnindia> any other methods
[14:05:25] <wizonesolutions> Is it feasible at all to use mongodump/mongorestore as part of a data export/import feature in an app, or is it better to abstract it to something like JSON and handle that?
[14:06:20] <Goopyo> wizonesolutions: are they putting in in a mongodb?
[14:07:05] <wizonesolutions> Goopyo: yeah, the data is in Mongo. multiple users, so I'd have to restrict the export dataset. but I think mongodump can do hat.
[14:07:06] <wizonesolutions> that*
[14:07:18] <Goopyo> it can
[14:08:05] <wizonesolutions> I figure I could do some version of it, but I am wondering if (probably for a first verison of this feature) it's wise or if I am going to encounter hard-to-solve problems and would be better off massaging the data more.
[14:08:08] <Goopyo> well if its going from mongo to mongo then you wouldn't need an abstraction
[14:08:52] <Goopyo> well you're constricting yourself to the functionality of mongodump
[14:08:56] <Goopyo> restricting*
[14:09:07] <wizonesolutions> Goopyo: Yeah, and also BSON isn't necessarily human-readable, so that'd be a minus≥
[14:09:18] <wizonesolutions> .*
[14:09:21] <Goopyo> yup plus if you ever need to omit data,etc
[14:09:33] <Goopyo> I'd go with standard mongodb reads off a secondary
[14:10:06] <wizonesolutions> cool, thanks for the thoughts
[14:37:33] <svnindia> how to tail the oplog for getting the actions on per second ?
[16:15:45] <wmnnd> Hey there, would this channel be a good place to ask a question about using Mongoid with MongoDB?
[16:16:24] <kali> yes
[16:18:00] <wmnnd> Great :)
[16:18:01] <wmnnd> I wonder how I can make it so that embeds_many creates a hash of embedded documents instead of an array.
[16:21:14] <kali> it sounds like a bad idea
[16:21:22] <kali> what kind of schema do you have in mind ?
[16:21:23] <wmnnd> Say I have those two classes here http://pastie.org/private/wcloy17pb69c8psqas8q and create an object of the class Manufacturer and then add a Product.
[16:21:44] <wmnnd> Then I would like to be able to use something like fiat.products.panda to access the embedded document.
[16:22:35] <kali> document and subdocument keys have to be *keywords* not value, or everything will become a nightmare
[16:23:04] <wmnnd> Why is that?
[16:24:13] <kali> well, that's the way mongodb is designed. if you don't use it this way, you'll struggle every step of the way: indexing will not work, query language will feel awkward, aggeregation pipeline will be even worth
[16:24:17] <kali> worse :)
[16:26:03] <wmnnd> Mhm … here is what I would like it to look like in JSON, just to be clear: http://pastie.org/private/bprwlhr9bfymupf3h1ijtg
[16:26:19] <kali> indeed
[16:27:00] <kali> you can re-organise it when emiting it to the browser
[16:27:24] <wmnnd> But that's something I would have to do manually?
[16:27:30] <kali> yes
[16:27:41] <wmnnd> What is the best way of accessing an embedded document then?
[16:28:57] <wmnnd> In that case, i would have to use fiat.products.where(name: "Panda")?
[16:31:00] <kali> that's a way. i don't know how mongoid handle this internally. i would make a get_product(name) on the manufacturer anyway
[16:32:05] <kali> be carefull with mongoid. it's known to do very stupid things when trying to look smart :)
[16:33:38] <wmnnd> So is it not recommended to use Mongoid?
[16:35:28] <kali> it's more subtle than that. it definitely saves time.
[16:35:55] <kali> you have to know where you can trust it and when you need to be wary
[16:36:09] <kali> for instance, can you tell what happens when you use fiat.products.where(name: "Panda") ?
[16:36:39] <kali> if "fiat" has already been pulled, the query can be made without hitting mongodb again
[16:37:08] <kali> but i'm pretty sure it will send the query to mongodb to get the full "where" semantics
[16:37:20] <kali> and that will make a big difference in terms of performance
[16:38:07] <disorder> hi
[16:38:30] <disorder> can I do something like this in mongo?
[16:38:31] <disorder> db['harem.files'].remove({$orderby: {uploadDate: -1}})
[16:38:59] <disorder> I want to remove a document based on ordering
[16:39:04] <kali> wmnnd: also, read what happens to that guy in this "success story" about mms: http://blog.mongodb.org/post/59009564965/surviving-success-at-matchbook-using-mms-to-track-down
[16:39:11] <kali> wmnnd: mongoi trying to look smart again :)
[16:40:08] <kali> disorder: remove remove everything matching. look at findAndModify, it has an option that will work
[16:41:59] <disorder> kali: ok thanks
[16:47:05] <wmnnd> kali: Thank you for your input, I will also look into the link you gave me :)
[19:47:37] <fg3> yo yo mongo
[21:45:46] <liquid-silence> hi all
[21:45:49] <liquid-silence> when doing insert
[21:45:57] <liquid-silence> can I return only specific fields?
[21:46:06] <liquid-silence> insert({ _id: new Mongolian.ObjectId().toString(), email: email, password: hash, name: name, role: role }, {"name": 1},function(err,
[21:46:09] <liquid-silence> does not seem to work
[21:46:42] <Derick> insertions don't return anything...
[21:46:52] <liquid-silence> ah would I need to do a find?
[21:46:59] <Derick> for returning data, yes
[21:47:15] <liquid-silence> well
[21:47:20] <liquid-silence> the function(err, user)
[21:47:25] <liquid-silence> the user object is populated
[23:17:34] <Djim> there are a lot of the errors of this kind
[23:26:57] <Djim> any help&
[23:26:58] <Djim> ?
[23:31:15] <Djim> Hey, is anybody here?
[23:40:57] <joannac> You would get a response much faster if you asked your question, rather than asking for someone to help.
[23:41:53] <jblack> Can I ask if it's ok to ask?
[23:42:03] <joannac> If you had asked your question, Djim, I could be working on it right now, rather than waiting for you to come back and ask :)
[23:42:49] <jblack> djim: Someone else wrote the driver, right? That's probably the person you want to ask for help.
[23:43:10] <joannac> Oh... he did ask. just earlier. My bad >.<
[23:43:32] <Djim> i suppose the problem is that i use -std=c++11
[23:43:48] <Djim> maybe i have to ask on boost channel
[23:44:02] <Djim> but it is very basic example and i can't get it to work((
[23:44:14] <Djim> i use ubuntu and gcc 4.8
[23:44:31] <Djim> my code depends on c++ 11
[23:44:51] <jblack> I've never tried using mongo in C++, but I do know C++, and I use ubuntu and gcc as well.
[23:44:57] <jblack> Which driver are you trying to use?
[23:46:49] <Djim> now i need to use mongo, but only adding #include <mongo/client/dbclient.h> gives me so many errors. Which driver? you mean which version?
[23:47:07] <Djim> and those are not linking errors
[23:48:56] <Djim> does anyone tried mongo C++ driver?
[23:49:05] <Djim> with gcc 4.8
[23:49:44] <jblack> I'm in over my head. I can't help. sorry
[23:50:01] <Djim> jback nevertheless thank you for the attention
[23:55:07] <Djim> jblack sorry, i've misspelled you nickname
[23:57:26] <Djim> but i found the the problem is with C++ 11 for sure
[23:57:31] <Djim> ls
[23:57:38] <Djim> wrong window, sorry
[23:58:33] <jblack> Djim: good to know
[23:58:49] <jblack> I'm not sure if g++ ended up with all of c++1x or not.