PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 17th of October, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[08:47:40] <craigbennett> Hi I have a noob question which hopefully someone can help with. I want to delete all arrays which contain 'a' from this document after searching for it by id, any advice?
[08:47:46] <craigbennett> {
[08:47:47] <craigbennett> "_id": xxx
[08:47:47] <craigbennett> "something" : [
[08:47:48] <craigbennett> [
[08:47:50] <craigbennett> "a",
[08:47:52] <craigbennett> "b"
[08:47:54] <craigbennett> ],
[08:47:56] <craigbennett> [
[08:47:58] <craigbennett> "d",
[08:48:00] <craigbennett> "d"
[08:48:02] <craigbennett> ],
[08:48:04] <craigbennett> [
[08:48:06] <craigbennett> "a",
[08:48:08] <craigbennett> "f"
[08:48:10] <craigbennett> ]
[08:48:12] <craigbennett> ]
[08:48:14] <craigbennett> }
[08:48:16] <craigbennett> sorry for the formatting
[14:38:49] <qswz> Hi people, any good pointers an how to do versioning of documents?
[14:38:54] <qswz> *on
[15:10:24] <mylord> how to insert into an array in a document?
[15:11:03] <mylord> but on the document mathcing _id:(ObjectId(theId))
[15:11:08] <mylord> ie, find and push
[15:26:05] <qswz> $push
[18:46:35] <rlf> hello. I like the concept of NoSQL, but I have only worked with relational databases so far and I somehow can't model my relational schema into JSON. What is the best practice for saving such a relational schema into a mongo database? http://puu.sh/kNGB9/10c579f7b3.png thanks in advance
[18:48:35] <cheeser> rlf: http://docs.mongodb.org/manual/data-modeling/
[18:48:42] <StephenLynx> rlf I assume the cpu psu and mobo tables will have more stuff to it?
[18:48:49] <rlf> StephenLynx: yeah
[18:49:02] <rlf> cheeser: i've read that but i still cant get around the modeling
[18:49:07] <StephenLynx> I would keep them on separate collections.
[18:49:15] <StephenLynx> but that would limit your queries.
[18:49:31] <StephenLynx> if this example is pretty much your use case, you might want a relational database.
[18:55:31] <rlf> well, i'm doing it because its an exerice, it's not on production environment
[18:55:39] <rlf> i suppose manual references are a good idea?
[18:55:48] <StephenLynx> depend on the situation.
[18:55:52] <StephenLynx> they might give you hell.
[18:55:57] <StephenLynx> they are a compromise.
[18:56:07] <StephenLynx> but a justifiable one,
[18:56:36] <StephenLynx> because of the lack of joins, they don`t act as well as they would on a RDB
[18:57:07] <rlf> so, generally, when i'm modeling my database i should rather think of the queries instead of the entities themselves?
[18:57:16] <StephenLynx> so if you relate many collections like that and you wish to retrieve all data from the referencing document, you will have to perform one query for each referenced collection
[18:57:44] <StephenLynx> no, you should ALSO think of the queries.
[18:57:45] <cheeser> doing that a lot suggests you might be better off embedding at that point
[18:57:58] <StephenLynx> if your relations are 1-1.
[18:58:09] <StephenLynx> if they are not, embedding will give you even more trouble.
[18:58:45] <cheeser> possibly, yeah.
[18:59:03] <rlf> well, the relationships on the screenshot i showed are 1-many, so i guess it's going to give me trouble :(
[18:59:12] <StephenLynx> lots
[18:59:22] <cheeser> not necessarily. but it's something to be aware of.
[18:59:30] <StephenLynx> 1-n works too for embedding
[19:03:33] <StephenLynx> ah, about the trouble: it would give you if you were to embed, imo
[19:03:43] <StephenLynx> if you were to reference, it would just limit you.
[20:22:55] <raj_> hey i am having a collection which contains almost billions of records...... and on them i am running aggregation pipeline to retrieve few months data..... but result is too slow.... the group by is running two slow... i need some help in performance tuning
[20:23:49] <raj_> *too slow i mean
[20:25:19] <raj_> anyone there????
[20:41:13] <JaAnTr> Hi, I am getting the following error - authenticate db: mytest , I have tried running db.auth() and db.addUser to add the user. Is there anything I have missed as it still is not working?
[23:01:30] <netameta> I am trying this:https://gist.github.com/yanivkalfa/163ec38dbbbcc0bcf943 and getting a recusion any idea why ?
[23:07:03] <StephenLynx> schema? bluebird?
[23:07:03] <StephenLynx> wot
[23:08:30] <StephenLynx> whatever your problem is, is not related to mongo