PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 20th of January, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:58:44] <Richhh> how can i use mongodb like a key value store, or a big array where i know the index i'm looking for?
[00:59:24] <Richhh> such that it wont iterate through anything
[01:04:48] <preaction> Richhh: every document you add to a collection has an ID. you use that ID to look up the document
[01:24:31] <langemann> Ok. I have multiple documents with the same key "category" and "subCategory", one "category" can have multiple "subCategory". Can I do a query of some sort to generate a document which is formed like this: category: "someCategory"{ all subCategories }?
[01:32:03] <Richhh> preaction: i believe in that case mongodb still iterates over all the documents in the collection to find the matching id, right?
[01:32:42] <Richhh> (or half on average)
[01:33:30] <preaction> the id is automatically indexed. it may have to scan the index to find your ID, but it could also build a tree out of the IDs or other ways to speed up index lookups
[01:34:08] <Richhh> interesting
[02:57:31] <strangewildthing> Anyone tried MySQL-to-mongodb replication?
[03:10:11] <a|3x> hi
[03:13:31] <a|3x> is it possible to clone a database by simply coping the the database file in /var/lib/mongo (after db.fsyncLock())?
[03:18:37] <cheeser> i believe that's the recommended way, actually
[03:24:07] <a|3x> cheeeser, there are a number of files, which ones do i copy and what do i rename?
[03:24:17] <a|3x> *cheeser
[03:29:03] <strangewildthing> should i be worried about using mongo for fund transfer without using transactions? traffic/load will be low
[03:29:34] <cheeser> document updates are atomic
[03:30:53] <strangewildthing> can u elaborate?
[03:43:28] <cheeser> when you update a document, it's either updated or not. there won't be a partial update to that doc.
[03:43:49] <cheeser> anyway. time for bed.
[04:31:15] <farkore> Hi =)
[04:31:43] <farkore> Can someone help me please?
[04:32:33] <a|3x> whats the problem?
[04:33:31] <farkore> I need to list all embbed documents, suppose I have Project document and have embbed comments
[04:33:43] <farkore> I want to list all comments for all Project
[04:34:04] <farkore> I had searched in google
[04:34:20] <farkore> but I have finded results
[04:34:21] <farkore> =(
[04:34:53] <farkore> haven't
[04:40:32] <farkore> any suggestions?
[06:00:24] <george2> I'm trying to do radius of gyration on a Mongo dataset to remove documents that move too far, too fast. Can anyone tell me if this is remotely possible in Mongo? http://i.imgur.com/dFgHdWR.png
[06:07:44] <samurai2> george2 : I think that possible, but you need to implement the function to do that by yourselves and maybe add some geolocation or aggregation framework to help filter the data. :)
[06:08:10] <george2> samurai2: I'm using GeoJSON on a 2dsphere, will that work?
[06:09:26] <samurai2> george2 : but if you said the location data on the mongodb dataset, then I guess you need to use geosphere filter in mongodb
[06:10:12] <samurai2> george2 : like in this link http://docs.mongodb.org/manual/applications/geospatial-indexes/
[06:11:05] <samurai2> george2 : I haven't used it a lot, but I guess you can try. :)
[06:14:15] <george2> samurai2: Yeah, I have all my data in a 2dsphere index in a mondo database, and am using Mongo's built-in GeoJSON support to store a single Coordinate point in each document. My problem is, I have no idea how to implement a formula like that using just mongo aggragations and such.
[06:14:44] <george2> my dataset is large enough that I can't do much to it outside of mongo
[06:17:27] <samurai2> george2 : then, I think you can use map/reduce in mongodb
[06:17:55] <george2> ok, I'll look into that, thanks.
[08:44:00] <jeanre> anyone around might want to help me design a data schema
[08:46:33] <ncls> jeanre: explain your problem and we'll tell you
[08:46:50] <jeanre> ncls mind a pm?
[08:47:06] <jeanre> I don't want to flood the channel with a brain dump
[08:47:19] <ron> it's probably better to ask in the main channel. people can learn and people can suggest.
[08:47:35] <jeanre> ok I have a books -> pages -> comments
[08:47:41] <jeanre> so pages will be an array
[08:47:51] <jeanre> and comments will be an array underneath pages
[08:48:14] <jeanre> I am trying not to use arrays as it makes it difficult to delete a comment
[08:48:32] <jeanre> I am using mongoose btw
[08:49:11] <ncls> jeanre: I use Mongoose too
[08:49:14] <ncls> in Perl, right ?
[08:49:19] <jeanre> nodejs
[08:49:21] <ncls> oh
[08:50:20] <ncls> anyway, your problem is mostly "relational"
[08:50:34] <jeanre> well a comment belongs to a page
[08:50:37] <jeanre> a page belongs to a book
[08:51:08] <ncls> you can do a simple "relational-like" schema, with 3 collections (book, pages, comments) by storing for each entry the id of its parent (parent book or parent page)
[08:51:51] <ncls> if you want a simple nested schema you can actually use array, and use the index of each element to handle it, for example
[08:52:46] <jeanre> what about named documents?
[08:52:46] <ncls> or you can use some of the "native" relational functions of mongodb, but I don't know how it's implemented in Mongoose for NodeJS
[08:52:46] <puppeh> if I have a unique index on a field, is there the possibility of having duplicated objects in a multi-threaded environment?
[08:53:20] <puppeh> in other words, do I need to synchronize the access or mongodb guarantees that there won't be any duplicate records because of the unique index?
[08:57:00] <ncls> puppeh: I think mongodb guarantees that
[09:03:55] <jeanre> the problem is the array in array
[09:03:59] <jeanre> its difficult to find shit
[09:04:05] <jeanre> unless I make it relational
[09:04:10] <puppeh> ncls: thanks but I need someone to tell me for sure :P
[09:05:10] <ncls> jeanre: in your book object, you could also store an array of pages, and an object "comments" like {page_number : [array of comments ]}
[09:05:34] <jeanre> yes
[09:05:39] <ncls> puppeh: haha, yes I understand
[09:05:44] <jeanre> but then fetching a comment by ID will be a pita
[09:06:06] <ncls> in which context will you fetch comments ?
[09:06:37] <jeanre> by id
[09:06:41] <jeanre> by page id
[09:07:00] <ncls> yes, but you want to display a list, and then click on one of them to display it ?
[09:07:39] <ncls> I think you need a relation schema
[09:08:07] <jeanre> yes
[09:08:12] <jeanre> but whats the use of mongo then :P
[09:08:23] <jeanre> is mongo not support to be non-relational
[09:10:50] <ncls> the use of mongo is to store objects / documents ... you can do relational "binding" between documents
[09:18:43] <Nodex> what's the problem?
[09:22:36] <jeanre> Nodex?
[09:27:25] <jeanre> can't one use named documents with mongoose?
[09:29:20] <ncls> it's like JSON with JSON linking
[09:31:57] <ncls> jeanre: the fact is your app is more a "relational type" so I can't convince you to use mongodb
[09:32:15] <ncls> but as your relational schema is quite simple, you can actually use it
[09:32:20] <Nodex> jeanre ?
[09:32:51] <ncls> mongodb and mongoose (as I know it in Perl) is awesome when you store objects and you want them to be "flexible"
[09:33:24] <ncls> for example, a User database in which you will be able to add fields and data very easily
[10:28:46] <kubber> hi guys, i don't know if it's mongo or node issue but .. when i new Date() in node i get os system timezone date, but if i do it in record.update or insert ( {date:new Date() } ) into mongo i get different timezone -> the one that i was using when i was installing mongodb ... is there a setting for this ?
[11:05:40] <theblackbox> hello all, I'm looking for a way to start mongodb as a service - at the moment running mongos locks the terminal to that running instance and I want to be able to script the init... also something like Forever would be an advantage for persistence
[11:12:26] <HarryT> service mongod start
[11:12:31] <HarryT> @ theblackbox
[11:12:44] <HarryT> (If you're on Linux)
[11:18:12] <theblackbox> =/ I looked for service and it appears to be a distro thing
[11:19:04] <crashev> why mongodb by default opens two ports 27017 and 27018 ?
[11:19:13] <whysobad> im trying to install it using
[11:19:13] <whysobad> PS C:\> C:\mongodb\bin\mongod.exe --config C:\mongodb\mongod.cfg
[11:19:24] <whysobad> --install
[11:19:41] <HarryT> Sorry, I cannot help further
[11:20:54] <theblackbox> agh, no it's not distro, my user just didn't have privs ;)
[12:20:13] <whysobad> i cant seem in input anything when i get to the mongo.exe shell
[12:20:39] <whysobad> i get stuck on connecting to: test and it stays there
[12:21:46] <whysobad> is there something i should be doing?
[12:40:12] <whysobad> solved the problem for anyone interested. mongo's shell is incompatible with cygwin, you have to run the executable separately
[13:42:10] <balboah> why isn't 2.4.9 listed in http://docs.mongodb.org/manual/release-notes/2.4/#minor-releases
[13:45:07] <ron> because it's a secret.
[14:01:24] <balboah> :)
[14:01:37] <balboah> I hope nobody experienced problems with it or something
[14:41:26] <tiller> Hi there
[14:42:29] <tiller> I haven't try to write the query yet, that's why I'm just asking you if you think it's worth it to try to write such aggregate (and if it's possible):
[14:42:37] <tiller> SELECT * FROM myCollection WHERE myAttr = myValue GROUP BY parentId HAVING theDate = max(theDate)
[14:43:15] <tiller> I want to retrieve the latest (according to "theDate") documents of my collection for each parentId
[14:45:29] <tiller> (and in fact, I'm not sure my SQL-query is right. It's been a while since I wrote one ;o)
[14:51:24] <landstalker> afternoon all
[14:52:06] <landstalker> we have a query which fires off now and again but is too large to provide information about what it's doing. This happens fairly regular. I was after suggestions on detective work
[14:56:13] <landstalker> I've already reviewed the data from db.currentOp and we're runnng 1.8.5
[15:06:32] <Nodex> tail your log
[15:22:10] <rafaelhb_> good morning
[15:22:33] <rafaelhb_> any suggestion or pointer on how to deploy mongod + replicas on aws elastic bean stalk
[15:25:50] <pbandyop> I am getting the following error in mongod.log file:
[15:26:03] <pbandyop> journal dir=/var/lib/mongodb/journal
[15:26:03] <pbandyop> Mon Jan 20 15:10:19.742 [initandlisten] recover : no journal files present, no recovery needed
[15:26:03] <pbandyop> Mon Jan 20 15:10:19.742 [initandlisten]
[15:26:03] <pbandyop> Mon Jan 20 15:10:19.742 [initandlisten] ERROR: Insufficient free space for journal files
[15:26:03] <pbandyop> Mon Jan 20 15:10:19.742 [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
[15:26:04] <pbandyop> Mon Jan 20 15:10:19.742 [initandlisten]
[15:26:06] <pbandyop> Mon Jan 20 15:10:19.743 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
[15:26:09] <pbandyop> Mon Jan 20 15:10:19.743 dbexit:
[15:26:15] <pbandyop> This demonstrates that the server has no more space available for journal. Will allocating more space to the server automatically solve the problem or do I need to manually do something to commit the new allocated space?
[15:28:02] <Nodex> use a pastebin please
[15:28:08] <Joeskyyy> As long as you add it to the root partition mongo is expecting you should be fine.
[15:28:17] <Joeskyyy> Unless of course you want a separate partition to run mongo on.
[15:28:23] <Joeskyyy> +1 to pastebin
[15:36:35] <redShadow> hi guys! I'm looking for a way to $unwind sub-documents in the main collection (i.e. have them as pure results, instead of wrapped in a single-key object) ---> http://paste.pound-python.org/show/70z9FRuV87jwf0w3rKeO/
[15:36:39] <redShadow> is it possible?
[15:37:02] <redShadow> (of course I can unwrap them in my application, but I want something cleaner if possible :))
[15:48:51] <pbandyop> What is pastebin? i am new, so don't knw abt it
[15:50:22] <kali> pbandyop: http://pastebin.com/ . use it when you want to show more than one line of code/text to someone on irc. pasting multiple line on IRC is considered rude
[15:58:28] <pbandyop> @Kali and then should i provide the link here?
[15:58:58] <kali> yep
[16:10:32] <dviramontes_> hey guys
[16:11:10] <dviramontes_> does anyone know how to nest schema
[16:11:33] <dviramontes_> with refs
[16:11:39] <dviramontes_> instead of arrays
[16:13:30] <kali> dviramontes_: you're obviously using mongodb through some kind of framework. you should tell use what it is to get some kind of answer
[16:17:00] <dviramontes_> ahh yeah, im using mean.io with mongoose adapter
[16:18:01] <dviramontes_> so express with angular frontend
[16:18:09] <dviramontes_> {}
[16:19:50] <dviramontes_> so schema = { profiles : { real : "foo", pass : "xxx"}, profile : ref : session } }
[16:20:00] <dviramontes_> that last part is giving me trouble
[16:21:20] <Nodex> that's not valid json - perhaps that's the reason?
[16:21:47] <imm6> ohh no that was a typo
[16:21:49] <Nodex> schema = { profiles : { real : "foo", pass : "xxx"}, profile : { ref : session } }
[16:21:49] <imm6> sorry
[16:22:08] <imm6> schema = { profiles : { real : "foo", pass : "xxx"}, profile : { ref : session } }
[19:04:39] <Ineentho> I have a problem starting mongodb from the debian init.d script provided by 10gen
[19:05:03] <Ineentho> It works fine starting as either root or the mongodb user using the mongod command
[19:05:14] <Ineentho> and I am pretty sure the permissions are correct
[19:05:24] <Ineentho> anybody have any clue what I could try?
[19:05:57] <Ineentho> "sudo /etc/init.d/mongodb start" > [FAIL] Starting database: mongodb failed!
[19:06:10] <Joeskyyy> Have you checked the logs?
[19:06:55] <Ineentho> No entrys there
[19:07:14] <Ineentho> at /var/log/mongodb/mongodb.log
[19:12:38] <tjbiddle> Hey guys - Apologize in advance for the noob questions. I don't have any experience with mongo, but I'm babysitting some systems for the next couple weeks and I need to setup mongo on one of them. I've used the database I need, and when I go to create the user I get "couldn't add user: not master" - Any suggestions?
[19:55:44] <_pash> hello, are symlinks possible in mongo? what i meas is if i have an entry in one collection who is a participant of another entry in another collection?
[19:56:09] <_pash> and by one query i would want to see all the participants of the entry in the second collection?
[21:40:26] <DrStein> Hi. I replaced a config server (new hostname). After the restart, it seems to have wiped out all the data from the configdb directory. Is that expected or did I do something wrong?
[22:01:26] <mst1228_> hey. is there any way to limit the length of an array in a model with a number field in the same model?
[22:53:09] <Industrial> Should I use mongodb for log messages? If so, could I name them by 'channel'? How would I efficiently get a list of channel names (for an index page)?
[22:55:43] <Industrial> oh, hello there http://docs.mongodb.org/ecosystem/use-cases/storing-log-data/