PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 30th of May, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:07:56] <jiffe> so with the perl connector is there a way to start query execution without blocking?
[00:46:39] <kurushiyama> jiffe: Well, threads? http://perldoc.perl.org/perlthrtut.html#Threaded-Program-Models
[03:16:51] <LowLifePerv> question. if i have dataset lookin like { _id: 1, item: "ABC", ratings: [ something: "ww", somethingelse: "qq" ] }, and i want to create index on the searchings of the term "somethingelse" how would i make it? like what command would i use?
[03:17:41] <LowLifePerv> to search it i would do db.survey.find( { ratings : { $elemMatch: {something: "ww"} } } ) right?
[03:17:47] <LowLifePerv> but what would the index be?
[03:53:03] <oky> oh, lowlifeperv is gone
[03:53:06] <oky> https://docs.mongodb.com/manual/core/index-multikey/
[03:53:19] <oky> so, they would make their index on the array like you would make any other index
[03:53:29] <oky> (ensureIndex)
[03:53:34] <ario> hmm
[03:53:40] <ario> i think im confusing myself
[03:54:15] <ario> i'm performing a query that takes one or two parameters or one and two parameters
[03:54:26] <ario> ok
[03:54:29] <ario> that makes sense lol
[03:54:37] <oky> ario: who are you talking to?
[03:54:51] <ario> i was going to ask a question
[03:54:55] <ario> then i answered it myself
[03:55:15] <ario> it haven't used mongodb in approx. a year
[03:55:30] <ario> i've forgotten everything ;(
[03:55:42] <oky> ario: you can use your nick to let others know you are talking to yourself. like: "ario: hmmm... i think i'm confusing myself"
[03:56:18] <ario> oky: but then people will think i'm crazy
[03:57:01] <oky> ario: too late
[03:57:29] <oky> ario: sorry, i'm just joshing around - congrats on solving your problem
[04:38:11] <ario> maybe it didn't work
[04:38:45] <ario> I want to perform a query that given a ParamA, a ParamB or both (ParamA and ParamB) would work
[04:39:51] <ario> is it (ParamA or ParamB) or (ParamA and ParamB) ?
[10:55:57] <dddh_> $39 a month
[11:12:49] <kurushiyama> dddh_: If that is Jeopardy, my question is "How much does CloudManager cost per server and month?"
[11:12:55] <kurushiyama> dddh_: ;)
[11:14:25] <dddh_> kurushiyama: started free trial of https://cloud.mongodb.com
[11:14:46] <kurushiyama> dddh_: Which makes sene.
[11:14:58] <kurushiyama> s/sene/sense/
[11:15:40] <dddh_> I won't pay $39 per server, currently using it for M122
[11:16:45] <dddh_> kurushiyama: "Getting Started with MongoDB Cluster Management"
[11:17:55] <kurushiyama> dddh_: Well, running MongoDB without metrics is like flying a fighter jet under the radar with your eyes blindfolded with one hand tied behind your back.
[11:18:37] <kurushiyama> dddh_: Especially for a sharded cluster.
[11:20:06] <dddh_> kurushiyama: it depends, in my case it just works, probably because I use it for some time, read some docs, books, passed M101P/102/202
[11:22:29] <kurushiyama> dddh_: I am a DBA associate and make most of my living of MongoDB administration. So what? Especially after m202, you should know that you can not make reliable predictions (and sweet spot dimensions can not be guessed).
[11:25:30] <dddh_> :)
[13:44:55] <makinen> can I use ming with dummy db?
[13:45:12] <makinen> for example a list of dicts as database
[14:07:01] <ario> is there a way to "do nothing" in a conditional satement
[14:10:01] <kurushiyama> ario: if foo == bar {baz()}
[14:10:27] <kurushiyama> ario: You probably should be a bit more specific about where you use your conditional, to what purpose and what not.
[14:10:57] <kurushiyama> ario: Where baz() is a noop in this example.
[14:11:34] <kurushiyama> ario: You could even write "if foo==bar{}", but then, you could equally write... nothing.
[14:33:37] <ario> kurushiyama: I want to perform a query that given a ParamA, a ParamB or both (ParamA and ParamB) would work
[14:42:06] <kurushiyama> ario: Params. Huh? You mean that on field can either have the value of ParamA or ParamB or both?!?
[14:42:18] <kurushiyama> ario: Please be _specific_.
[14:42:35] <kurushiyama> ario: Even better, give an example what you are looking for.
[14:45:12] <ario> kurushiyama: i just did it simple if statements
[14:45:29] <ario> kurushiyama: i wanted to make some fancy mongo query to do it but i was over thinking it
[14:45:59] <ario> kurushiyama: basically what you said
[14:46:02] <kurushiyama> ario: Ok, you have docs. {_id:someObjectId, foo:"bar"} for example.
[14:46:35] <kurushiyama> ario: And now you want a query which checks foo to be either "bar" or "baz" or both?
[14:47:21] <ario> I have {_id:someObjectId, foo:"bar", foo2:"bar2"}
[14:47:42] <ario> and i wanted a query to find only foo, only foo2, or both (foo and foo2)
[14:48:44] <kurushiyama> ario: on which condition? wether they _exist_? What do you want to _do_? remember, I can not read your mind...
[14:49:51] <ario> yeah basically if they exist,
[14:52:57] <kurushiyama> ario: db.yourcoll.find($or:[{foo:{$exists:true}},{foo2:{$exists:true}},{foo:{$exists:true},foo2:{$exists:true}}])
[14:53:11] <kurushiyama> ario: I just try to imagine the use case.
[22:29:57] <kaseano_> Hi, I was very happy to find out I could use $in with an array of objects. However I'm trying to figure out if I can do the same thing from the root level of a document, ex: http://pastebin.com/izkSGDX3
[22:41:50] <oky> kaseano_: that would be a regular query, is my understanding - can you explain what you are intending $in to do?
[22:42:35] <oky> (the example is somewhat ambiguous because your $in clause is the same as the data in the object, so i am unsure what you want $in to do)
[23:03:18] <kaseano_> sorry oky didn't get pinged
[23:05:23] <kaseano_> oky, I have a situation where i need to join collections. I know relational's better for that, but it still performs fine if I add foreign keys in one collection, then use a hash from the application to join the docs. Right now i'm trying to add the FKs when the records are first created. I can't collection.insert([...]) because it will fail with duplicate documents, however I can bulk upsert() to get the docs in there. I can'
[23:05:24] <kaseano_> get the ID from the original insert because it might not insert every time, so I have to re-query those records to get the IDs off them. In order to do that, I need to find all the docs with the matching indexed properties
[23:06:09] <kaseano_> I have "address" docs, and another collection sharing the address docs (creating them if they don't exist)
[23:06:43] <kaseano_> and the address doc has a unique index on "street,city,state,country"
[23:07:46] <kaseano_> maybe I over-described it sorry. Basically I'm joining tables together using multiple properties, and the only way to do that seems to be putting those joined properties into an object, so they can be used in $in
[23:16:15] <oky> kaseano_: i meant, when you have a doc: { a: 1, b: 2, c: 3, d: 4}, what do you want .find($in: { a:1, b:2 }) to do?
[23:19:04] <kaseano_> oky: I have to find all the docs in one collection based on the properties on docs in another collection, so it'd be like, { (a:1 and b:2) or (a:3 and b:4) }
[23:20:11] <oky> kaseano_: this is a regular set of conditions for a query, isn't it?
[23:20:44] <oky> .find({a: { eq: 1}, b: { eq: 2}) or similar
[23:21:29] <kaseano_> I'm not sure what eq is one second
[23:21:29] <oky> i think it can be shorthanded into: .find({a: 1, b:2}), even
[23:21:52] <oky> kaseano_: https://docs.mongodb.com/manual/reference/operator/query/eq/ (i forgot to prefix with $)
[23:21:59] <oky> $eq(uals)
[23:22:12] <kaseano_> oh ok, yeah except a can have multiple values (or up to 3000 values in some cases)
[23:22:33] <kaseano_> I could run it through a loop, but I'm so close to accomplishing it with one request though
[23:24:29] <oky> kaseano_: i'm not clear what you want $in operator to do, still - what .find({$in: { a: 1, b: 1}) would return - all documents that have a:1 and b:1?
[23:25:44] <kaseano_> sorry I'm probably not describing it correctly, I'll make another pastebin real fast
[23:25:52] <oky> kaseano_: something like .find(a: { $in: [possible_values] }, b: { $in: [other_values]})?
[23:30:26] <oky> or, you want an $or condition as well
[23:31:34] <kaseano_> yes that's it oky exactly
[23:31:47] <kaseano_> except the values are tied together
[23:32:21] <kaseano_> that's why find { abvals: { $in [ {a:1,b:2}, {a:3,b:4}] } works, except it has to be in a subproperty
[23:32:47] <oky> kaseano_: .find($or: [{ a:1, b:2}, {a:3, b:4}])
[23:33:17] <kaseano_> really?? I didn't know that was an option, I'll try it right now
[23:33:24] <kaseano_> thanks oky
[23:51:54] <kaseano_> oky it worked! Thanks so much for your help! http://pastebin.com/0vGUiMcR
[23:56:17] <oky> kaseano_: cool! np