[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?
[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).
[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: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: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