PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 6th of January, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:07:00] <mclenithan> I have a DB = entries, I use entries.find() too pull up all entries. what do I put to get only the first four?
[01:07:07] <mclenithan> javascript, node.js
[01:59:56] <_aegis_> mclenithan: limit
[04:01:09] <timah> for document _ids such as: _id: { g: 123, o: ObjectId() }… does the order of properties actually matter? the end-result should allow me to query a date range for a given g (group).
[06:12:41] <Raynos> safe: true is deprecated
[06:12:43] <Raynos> what should I use instead
[07:12:18] <adibis> hi, trying to get the next and previous item in a database in alphabetical order. I am not able to do that. I could construct a query with the id field and use id.lt and id.gt to get the next item by id but that is not alphabetical. Can someone point me to a tutorial or document that explains getting next items by alphabetical order?
[07:13:19] <_aegis_> .sort
[07:15:07] <adibis> yes, sort is sorting the records. How do I compare it with the current record and then get the next item from the sorted list. That's not working.
[07:15:58] <adibis> for example, I am on M right now. Sorting gave me a sorted list, A..Z. How do I iterate through the list till I reach M and then return the next item from this sorted list, which is N.
[07:18:52] <joshua> Hey I am not much of a coder and I am trying to come up with an easy way for other guys on my team to run a find through a shell or perl script
[07:19:09] <joshua> I can run a query by passing javascript to mongo, but how would you take user input for the search string I am wondering
[07:19:33] <joshua> unless I do it through eval
[07:20:27] <joshua> Hmm I guess that might work if I just put it all in one eval
[07:23:42] <_aegis_> :)
[07:24:27] <joshua> I should just have an empty channel I type things into and then realize I just answered my own question
[07:33:10] <joshua> I guess what got me stuck earlier when I was trying eval is running a find
[07:33:17] <joshua> Something like this works fine --eval "printjson( db.customer.findOne() )"
[07:37:39] <adibis> exit
[14:34:35] <jaraco> I've encountered an issue and it's not clear to me where the issue lies.
[14:35:04] <jaraco> I'm prompted for authentication credentials when trying to push no changes to bitbucket.
[14:35:14] <jaraco> It only happens with the hgcollapse project.
[14:35:15] <jaraco> http://paste.jaraco.com/PvZMw
[14:35:54] <jaraco> I don't have credentials to push to that repo.
[14:36:20] <jaraco> But I also don't have any local changesets, so I wouldn't expect to have to authenticate.
[14:36:21] <kali> jaraco: wrong # i think
[14:36:32] <jaraco> kali: sorry
[14:36:54] <kali> no prob
[14:42:03] <Virunga> Hi
[14:44:37] <Virunga> Could you give any advise about the document structure for storing irc channel messages, that have different properties, such that retrieving all message of a channel, of a specific day, ordered by time would be easily as possible?
[14:47:34] <Virunga> I thought these solutions, { channel:"channel1", /* day from the 1970 */ 12345435435: { /* messages */ "10:03": {event:"join", nick:"..", host:"..." }, "10:50": {event:"mex", from:"..."}, ...}, 43245645645: {....}}
[14:49:12] <Virunga> Or meaby, {channel:"channel1", day:324342342, hour:"00:01", message: {...}}
[14:49:24] <kali> the latter is better
[14:49:54] <kali> you need to avoid using variable as key names if you want to sarch on it
[14:50:32] <kali> but you can mix the two: grouping the messages per channel and day is actually a good idea, performance wide
[14:52:28] <kali> { channel:"channel1", day: 12345435435, mesages: [{ hour: "10:03", event:"join", nick:"..", host:"..." }, { hour: "" ... }, ... ] }
[14:53:06] <Virunga> Good idea!
[14:54:29] <Virunga> is it ok append a message each time it arrive, of should i do this sometimes? Because i'd like to show the logs in realtime like a chat
[14:54:50] <kali> it can be a bit expensive
[14:55:20] <kali> mongodb will pad a lot
[14:55:37] <Virunga> I see.
[14:55:38] <kali> but... irc is not a huge traffic anyway
[14:55:58] <kali> so that should be fine
[14:57:25] <Virunga> yeah, as far as there's only some second of delay, it's ok.
[14:57:54] <Virunga> Then i'm doing this to learn, so...
[14:58:11] <Virunga> kali: you were very kind, thank you for your support!
[15:00:44] <Virunga> Oh, why is this channel invisible?
[15:00:58] <Virunga> It doesn't appear in the channel list
[15:01:05] <Virunga> Not only for me
[15:01:09] <kali> most channels are
[15:01:43] <Virunga> People struggle to find it, like this
[15:02:23] <kali> nobody use the channel list :)
[15:02:48] <kali> people get there by guessing, or by being referenced by the web site
[15:02:53] <kali> look at the number of people here
[15:03:04] <kali> i don't think we need to worry about people not finding this place
[15:04:25] <Virunga> ehehe
[15:05:00] <Virunga> Bye! :)
[15:48:05] <bigmeow> lol
[15:48:10] <bigmeow> meow is coming:)
[16:09:54] <bigmeow> anybody here?
[16:25:58] <bigmeow> meow:(
[16:33:51] <bigmeow> BurtyB: meow:)
[16:34:51] <BurtyB> ?
[16:42:11] <jtomasrl> is it possible to use $addToSet to create the field if not exists?
[16:45:43] <kali> jtomasrl: this is what it does
[16:46:04] <jtomasrl> Cannot apply $addToSet modifier to non-array
[16:47:20] <jtomasrl> wait it worked now :P
[16:48:27] <kali> jtomasrl: i guess the field was already there, but not an array
[16:49:11] <jtomasrl> kali, I add some data by mistake and was giving error
[16:56:18] <bigmeow> BurtyB: it's 0:55 here:(
[18:38:17] <bigmeow> hi all
[18:38:29] <bigmeow> i have a question:)
[18:40:41] <kali> just ask.
[20:47:41] <Ro__> hello, I cant find GRIDFS get_version method in a php driver.
[20:48:04] <Ro__> It's not implemented or I need to map reduce myself?
[21:08:59] <ExxKA> Hey Guys. I have been wondering how to utilize the database vs. connection object. Does the nodejs driver handle connections in some central place, so that I can just fire new queries without managing connections myself?
[21:10:10] <wereHamster> to send a query to the server you need an open connection
[21:12:03] <ExxKA> wereHamster, Yes I am with you that far, but once I have an open connnection do I need to handle how many, and which ones are available for another query?
[21:13:11] <wereHamster> one is enough
[21:13:24] <wereHamster> and it's always avialable for a query
[21:14:14] <ExxKA> I get an error saying "db object is already connecting, open cannot be called multiple times", and that is because I try to fire several queries at the same connection
[21:14:27] <wereHamster> are you calling open() multiple times?
[21:15:10] <ExxKA> Not that I am aware of
[21:15:42] <ExxKA> .. well actually I might be
[21:15:54] <ExxKA> sry about that, let me just take a second to go over some of my code again
[21:19:40] <ExxKA> I was not closing correctly. Sry about that. Thanks for your help wereHamster .
[21:19:50] <wereHamster> why would you close the connection?!?
[21:19:59] <wereHamster> you close it once when your app is shutting down
[21:20:08] <wereHamster> you open it once when your app is starting up
[21:20:46] <ExxKA> Because I am writing unit tests, and between each test suite I rebuild the database on a new connection
[21:33:56] <xeviox> hi guys
[21:35:22] <xeviox> I'm totally new to mongodb and be lost with a (hopefully) simple problem. My document structure is like "http://pastebin.com/z4qC9v8x". No I try to get all samples with a specific "borrower".
[21:39:04] <xeviox> I tried using the query " query: { samples.borrower: "another.user@example.com" } " (taken from the logs)
[21:39:24] <xeviox> forget what I said
[21:39:38] <xeviox> it will never filter the examples right?
[21:40:06] <xeviox> it will return all docs that contain a sample with the queried borrower
[21:40:11] <xeviox> right?
[21:46:36] <kali> xeviox: yes
[21:47:27] <kali> xeviox: you may want to check out the aggregation framework to $unwind the samples for the matching docs and filter the matching samples
[21:48:16] <xeviox> kali: so it may be possible with a standard install (couldn't setup more)
[21:49:32] <kali> aggregation framework is part of a the standard install
[21:50:12] <kali> i'm not aware of anything not being a standard install tbh
[21:50:46] <kali> i mean except for sharding and replication, which have very marginal impact on the feature set, all install are equivalent
[21:51:10] <xeviox> kali: cool thanks
[21:53:02] <xeviox> from what I've seen "$unwind" will "split" samples into documents, is it possible to filter that result?
[21:58:11] <xeviox> will db.book.aggregate( { samples.borrower: "someone@example.com" }, {$unwind: "$samples"});
[21:58:21] <xeviox> return just the samples (not filtered)?
[22:16:04] <xeviox> seems I don't get it :(
[22:16:08] <xeviox> I try with: command: { aggregate: "buecher", pipeline: [ { samples.borrower: "another.user@example.com" }, { $unwind: "$samples" } ] }
[22:16:41] <xeviox> but just receive: Pipeline::run(): unrecognized pipeline op \"borrower" , "ok" : 0.0}
[22:28:53] <xeviox> ok think I got it
[22:29:00] <xeviox> kali: thanks for pushing me in the right direction :D
[22:46:47] <xeviox> is it possible to "change" a single type of field to a list? (e. g. { Books { name: 'name', sample: { 'id': 1} } } => {Books { name: 'name', sample: [ {'id': 1} ] } } )
[22:47:01] <xeviox> using the aggregate framework
[23:02:49] <Bilge> Hello mongomans, is it possible to have the same ID generated within a database between different collections?
[23:04:12] <Virunga> Hi
[23:04:44] <Bilge> In other words, in what scope is a MongoID guaranteed unique?
[23:05:39] <_pid> bilge: every mongoId you "request" will be unique
[23:06:29] <Virunga> Could you help me with this query, http://pastie.org/5632857 T
[23:06:34] <Virunga> ?
[23:06:49] <Virunga> I don't want the $ in the document
[23:10:46] <Virunga> I'd like to find the document with id:'ch1', with an array that contains a document with field day with value 'ieri', and push a new element inside the messages array contained in that document.
[23:10:53] <Virunga> I don't know if that's clear :P
[23:11:06] <_pid> Bilge: http://docs.mongodb.org/manual/core/object-id/
[23:15:38] <Virunga> I take inspiration from the documentation, except that there, update the same field searched
[23:16:04] <Virunga> And i use push instead of set and the value is a sub-document
[23:16:09] <Virunga> I don't get it...
[23:22:44] <Virunga> The doc says that save is equivalent to update with a query argument on the _id field and upsert opt, but i get an error with same expression changing only update in save :/
[23:23:01] <Virunga> can't have . in field name
[23:41:43] <Virunga> Please, help?
[23:58:28] <Virunga> The query works if the document already exists, otherwise it creates the document as in the link, with $ as field key...
[23:58:44] <Virunga> Why?