PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 18th of April, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:13] <Boomtime> d4rklit3: provide a gist/pastebin of a sample document and what you want to query on, your description sounds like a very basic query, so perhaps i am missing something
[00:02:07] <d4rklit3> http://pastie.org/10099112
[00:02:13] <d4rklit3> so where that categories is
[00:02:16] <d4rklit3> its an ObjectiD
[00:02:32] <d4rklit3> i need to "populate" that object ID
[00:02:40] <d4rklit3> and check if it matches a particular categor
[00:02:52] <d4rklit3> im suing mongoose though
[00:02:59] <d4rklit3> well so keystonejs claims i am :P
[00:04:45] <d4rklit3> i think actually that post sums it up
[00:04:51] <Gevox> If i do something like this query.put("title", obj.title);
[00:04:51] <Gevox> dbCollection.remove(query);
[00:05:09] <Gevox> will mongo remove the entire document from the collection or just the data field of title?
[00:05:35] <cheeser> what happened when you tried?
[00:06:08] <Gevox> i didn't yet. I only wondered about it while making the method
[00:06:19] <Gevox> i will tho, to confirm
[00:06:38] <cheeser> the javadoc explains the behavior as well
[00:06:59] <d4rklit3> ok well this filtering thing works
[00:07:16] <d4rklit3> but paginating this will be damn near impossible
[00:08:18] <d4rklit3> Boomtime, is this possible with one query?
[00:09:22] <Gevox> cheeser: yes, thanks for the reminder
[00:14:23] <Gevox> I have a strange issue, i insert a document into a collection with some data, however, all of the data are stored the same as i inserted except 1 field is getting inserted with a constant value of "Test #1"
[00:15:33] <Gevox> pastepin: http://pastebin.com/WpDNHZ07
[00:16:39] <Boomtime> d4rklit3: i'm not clear on what query you actually want
[00:16:50] <d4rklit3> did you see my pastebin
[00:16:54] <Boomtime> yes
[00:16:58] <Boomtime> that's a document only
[00:17:04] <d4rklit3> so i want to query Project
[00:17:08] <d4rklit3> based on category.slug
[00:17:10] <Boomtime> do you want to find any document that contains a particular category?
[00:17:13] <d4rklit3> yeah
[00:17:39] <Boomtime> .find({category:ObjectID()})
[00:17:51] <d4rklit3> well i don't know the ObjectID()
[00:17:52] <d4rklit3> i know the slug
[00:18:14] <Boomtime> ok, so you want to find a document that has a particular slug?
[00:18:25] <d4rklit3> a document whose category has a particular slug
[00:18:37] <d4rklit3> so i would need to populate that ObjectID
[00:18:54] <Gevox> nvm, i figured it.
[00:19:12] <Boomtime> categories appears to be an ObjectID, what do you mean "has a particular slug"? are you talking about a join?
[00:19:50] <Boomtime> if so, mongodb has no joins, you will need two queries, or modify your schema to embed the information
[00:23:43] <d4rklit3> yeah ... :(
[00:23:45] <d4rklit3> lol
[00:24:03] <d4rklit3> however would i could doooo
[00:24:11] <d4rklit3> lets say if i had the id
[00:25:03] <d4rklit3> could i then do find(category:{$in:{_id: [id1,id2,id3]}
[00:25:11] <d4rklit3> i figure i can cache all the tags/categories
[00:25:12] <d4rklit3> up front
[00:25:20] <d4rklit3> and then i would have their IDs
[00:32:24] <d4rklit3> Boomtime, i figure if if taxonomy documents are really small compared to project documents that are huge in comparison, it would smarter to just query all the tags and categories ahead of each request (cache them in memory too) and then query my projects against those id's that already exist?
[00:36:07] <Boomtime> do you mean this -> "find(category:{$in:[id1,id2,id3]}" ?
[00:42:57] <d4rklit3> yes?
[00:43:39] <d4rklit3> where the id1,2,3 is the ObjectID
[00:48:15] <Boomtime> right, that find will match any document whose category array contains one (or more) of the objectids in the $in array
[00:48:28] <Boomtime> btw, you want to index category
[00:50:46] <d4rklit3> for speed
[00:50:49] <d4rklit3> or for it to work
[00:51:53] <d4rklit3> so categories is this: [553168297af42eda6da86b98]
[00:51:56] <d4rklit3> err
[00:52:01] <d4rklit3> ["553168297af42eda6da86b98'"]
[00:52:12] <d4rklit3> does this need to be ObjectID("553168297af42eda6da86b98")
[00:54:14] <Boomtime> you need to match the value, ObjectID is a particular type, distinct from string, so ObjectID("553168297af42eda6da86b98") != "553168297af42eda6da86b98"
[00:54:21] <d4rklit3> ok..
[00:54:31] <Boomtime> either one will work, but you must be consistent
[00:54:35] <d4rklit3> hmm lets see where do i get this ObjectID
[00:54:40] <d4rklit3> in the array its ObjectID()
[00:54:42] <Boomtime> ObjectID will take up less space, and be slightly faster to match
[00:54:45] <d4rklit3> not just the string
[00:54:56] <d4rklit3> I need to get that type from somewhere
[00:58:15] <Gevox> Does it seem good way of using $set to update several fields in mongoDB like this? http://pastebin.com/bWF5kHqr
[00:58:43] <Gevox> update several values*
[00:59:19] <d4rklit3> i think so
[00:59:22] <d4rklit3> how else?
[00:59:35] <Gevox> i dunno, i feel like an abuser for the $set to group update values
[00:59:47] <d4rklit3> o wait
[00:59:48] <d4rklit3> java
[00:59:54] <Gevox> yes java
[00:59:57] <d4rklit3> you should be abe to do this all in one
[01:00:03] <Gevox> how sir?
[01:00:05] <d4rklit3> htough i dunno anything about the api you're using
[01:00:13] <d4rklit3> $set: [{},{},{},{}]
[01:00:26] <Gevox> $set would take an array?
[01:00:27] <Gevox> let me try
[01:00:33] <d4rklit3> i think so
[01:00:40] <Gevox> wait, no. I use append not $set
[01:00:55] <Gevox> and append takes type of append which is $set and the value ( 2 parameters method )
[01:01:07] <Gevox> http://i.imgdady.com/baBoyB.jpg
[01:04:18] <d4rklit3> lol i dunno
[01:04:24] <d4rklit3> how do i use an ObjectId() ?
[01:06:59] <d4rklit3> ok i have no idea
[01:09:53] <d4rklit3> Boomtime, you know how to use the ObjectId in mongoose? when i do the $in query i just get a cast error
[01:10:12] <d4rklit3> using it like this: new ObjectId(taxonomy.id)
[01:12:26] <d4rklit3> q.where({categories:{$in:categories}}); , where categories is an array of those objects
[01:18:07] <d4rklit3> this is confusing
[01:21:33] <d4rklit3> could some1 tell me how to do this the right way? http://pastie.org/10099150
[01:24:28] <Gevox> I'm trying to update several values of a document, this the method i made, however, it only updates the value in the last line of $set (the description). http://pastebin.com/L58fdARN
[01:24:41] <Gevox> How can i propely update several values of a document at once?
[01:35:10] <d4rklit3> i dunno :(
[01:36:53] <Gevox> <d4rklit3>: We both don't know a lot of things, we should get banned of this channel :p
[01:37:00] <d4rklit3> lol
[01:38:59] <d4rklit3> i need match a document if the categories[] has the ObjectId in question
[01:39:02] <d4rklit3> $in should do this!!
[01:39:15] <Gevox> what language do you use?
[01:40:36] <d4rklit3> javascript
[01:57:30] <d4rklit3> well i ifigured my shit out
[01:59:20] <Gevox> <d4rklit3>: lol i did mine too
[02:02:21] <d4rklit3> beers then
[04:43:05] <reactormonk> I'm trying to import some dump into my mongodb - local version is 3.0.2 - but mongorestore gives me a lot of "don't know what to do with file X"
[04:44:44] <reactormonk> version mismatch possible? I would assume mongorestore can read the old data
[04:58:04] <Boomtime> reactormonk: what version is the source from?
[04:58:46] <Boomtime> if in any doubt, try the equivalent version of mongorestore versus the mongodump you used
[08:05:57] <afshinmeh> hey
[08:06:26] <afshinmeh> can someone help me to answer this question: http://stackoverflow.com/q/29714227/375966
[08:06:56] <afshinmeh> I'd like to know whether this is possible to write a realtime wrapper for MongoDB or not?
[11:56:40] <mazzy> hi
[11:56:54] <mazzy> since copyTo method is now deprecated in 3.0 version
[11:57:19] <mazzy> which could be a good way to move document from a connection to one other ?
[11:58:00] <mazzy> I need to move document from one collection to one other removing them to the sourc collection
[13:40:19] <abdulrehman> hello
[13:40:41] <abdulrehman> Just wanted to know, I am currently working with erlang and I can not find a driver which is up to date with MOngodb
[13:40:44] <abdulrehman> any advice?
[13:42:06] <cheeser> change languages?
[13:42:22] <cheeser> the erlang driver is pretty dormant these days afaik
[13:43:44] <abdulrehman> I would really like to keep using erlang,
[13:44:15] <abdulrehman> its too late to change and I really prefer not to... Erlang pretty good language
[13:44:27] <abdulrehman> any other alternative you'd suggest?
[13:44:46] <abdulrehman> beside writting my own driver hahaha
[13:46:26] <cheeser> you could contribute the existing driver. fill in the gaps.
[14:00:20] <abdulrehman> the mongodb one? or a thirdparty?
[14:00:33] <abdulrehman> currently I am not sure which is the best to build on the top of
[14:00:35] <abdulrehman> ?
[14:02:55] <cheeser> i think there's only the one but i'm pretty far from that community
[14:03:29] <abdulrehman> alrighty.... I'll digg deeper and see what I can find. Many thanks for the help
[15:51:13] <isale-eko> http://stackoverflow.com/questions/29719471/mongodb-mongoid-rails-unable-to-increment-counters-in-a-hash-in-embedded-documen
[18:06:58] <abdulrehman> is there any written artical on how to design nosql (specially mongodb) collections?
[18:07:33] <abdulrehman> I come from Rational DBs and i am finding it very hard to desing a NoSQL Document oriented collection
[18:50:07] <diegoaguilar> Hello, I want to use mongodb in order to store some paths (routes given by coordinates along a highway path)
[18:50:43] <diegoaguilar> and then query giving a pooint and I should know if my point is "near" or "in" the path
[18:51:05] <diegoaguilar> I wonder if I can alredy get such operation from an aggregation