PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 15th of May, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:00:41] <sneumann_> ah, I can see the data via "db.sysmodels.find()", BUT NOT show collectiosns ???
[00:02:09] <sneumann_> The data was imported from a dump via via mongorestore . Still no idea why show collections does not return anything. This is a mongo 3.2.6
[00:04:41] <sneumann_> weird. Good night
[07:44:02] <mylord> how do you find where subdoc=x in any doc? and is it performant?
[09:34:43] <saira_123> One simple question Guys , If MongoDB flushed data every 60 second by default right? So if i insert a document and query it again ,will it fail as the document is not inserted to disk yet ?
[10:13:48] <saira_123> One simple question Guys , If MongoDB flushed data every 60 second by default right? So if i insert a document and query it again ,will it fail as the document is not inserted to disk yet ???
[10:14:16] <saira_123> beacuse The data directory contains the journal files, which store write operations on disk before MongoDB applies them to databases. how can Mongo Read what is not present in database?
[10:14:26] <saira_123> how can Mongo Read what is not present in database?
[13:27:56] <Industrial> Hi. Say I have a lot of documents structured like: https://gist.github.com/Industrial/bd6fd7baf8da3f2562ed21c398ffd650
[13:28:23] <Industrial> Given a lat/lng pair, what is the matching nl_sixpp value, is what I'm interested in querying
[13:28:33] <Industrial> Do I need a geospatial index for this?
[13:51:43] <kurushiyama> Industrial: You should utilize one. Without indices, queries result in a collection scan, which means that _every_ document gets read from disk any analyzed.
[13:52:03] <kurushiyama> s(any/and/
[13:57:14] <kurushiyama> Industrial: I'd suggest https://docs.mongodb.com/v3.0/tutorial/build-a-2dsphere-index/ for your application, requiring you to modify your document structure slightly.
[14:18:39] <Industrial> kurushiyama: sure that's fine :-) thanks!
[14:18:57] <Industrial> 7528163 docs tho, lmao.
[14:23:11] <Industrial> kurushiyama: What's the best approach for modifying this amount of documents? Can I use a findAndMofidy query?
[14:34:22] <Industrial> made a simple forEach.
[17:45:18] <kurushiyama> Industrial: back. Did you get along?
[17:56:45] <alexandernst> I have a collection in a MongoDB database. Each document has (among others) one object field that looks like this: name: {"en-US": "Foo", "es-ES": "Bar", ... }. The en-US key is guaranteed to exist, but any other keys/values are not. Is there a way I can query the documents in such a way that the result would contain the field name ("name") and the value of that field would be either the language I passed (let it be es-ES) or if that
[17:56:45] <alexandernst> key doesn't exist, the value of en-US? Example result: { name: "Bar" }
[18:16:36] <oky> alexandernst: yes, https://docs.mongodb.com/manual/reference/operator/aggregation/cond/ (conditional expressions)
[18:18:22] <alexandernst> oky: I'd me missing one more operator (for the if condition). How can I test if "es-ES" exists?
[18:22:05] <oky> alexandernst: it's been a while, but i think you add multiple conditions, like $exists and $neq null
[18:22:21] <oky> alexandernst: be creative
[18:22:38] <kurushiyama> alexandernst: Your basic problem here is that you use a value ("en-US"...) as a key.
[18:23:12] <alexandernst> yes, so I need to find *something* that would allow me to retrieve all the object keys in "name"
[18:23:50] <alexandernst> and then use $exists to check if what I'm looking for exists, or if I shuld just default to en-US
[18:23:55] <oky> alexandernst: maybe, $ifNull
[18:24:10] <Industrial> kurushiyama: yes, the forEach eventually finished and I managed to make relevant queries :-)
[18:24:26] <Industrial> so I now have a postal code micro service \o/
[18:24:37] <oky> alexandernst: https://docs.mongodb.com/v3.0/reference/operator/aggregation/ifNull/#exp._S_ifNull(and the related section on expressions)
[18:24:45] <kurushiyama> alexandernst: I guess (haven't tried, though) that if you have sth like name:[{language:"en-US",translation:"Foo"}...], a simple $or should do it.
[18:25:22] <alexandernst> kurushiyama: yeah, that would works like a charm. But I can't modify the existing data structure
[18:26:39] <kurushiyama> alexandernst: Well, I'd escalate that instantly. You already have amounted technical debts with the model as it is now, and with working around it, you are increasing the technical debts.
[18:27:05] <kurushiyama> Industrial: Glad I could be of help!
[18:27:26] <alexandernst> kurushiyama: yes, I'm aware of that, but really, I literally can't fix what's already in there. I have been asking for green light on that, but no luck
[18:27:48] <alexandernst> it doesn't depend on me (if that was the case, I'd do it)
[18:29:27] <kurushiyama> alexandernst: You have my sympathy.
[18:29:38] <alexandernst> \o/ it's something
[18:30:07] <kurushiyama> alexandernst: As in condolences ;P
[18:30:18] <alexandernst> yeah, yeah, I got it :P
[18:32:33] <kurushiyama> alexandernst: Seriously, conciously building up technical debts in something as fundamental as data modelling show some severe... ...impediments, to stay in agile terminology.
[18:34:57] <kurushiyama> alexandernst: With those constraints, oky is probably right. Still try to wrap my head around it how to find an efficient way. Since presumably this is for localization, speed might be of importance.
[19:08:57] <jan888916546465> hi
[19:09:14] <alexandernst> oky: did it :) https://paste.kde.org/pj4zee7ai
[19:09:38] <jan888916546465> I have some problems with spatial aggregation queries. I currently participating a hackathon and would need some help with query optimization
[19:10:03] <jan888916546465> Any experts about geospatial in here?
[19:21:15] <jan888916546465> I have a $geoWithin aggragation with sorting and grouping which takes about 1 Minute for approx 5million documents,
[19:21:29] <jan888916546465> Of course I set an index but not sure if it is used
[19:22:27] <jan888916546465> Also the same query with $geoNear only takes about 1 second including all sorting and stuff
[19:22:56] <jan888916546465> The porblem is that this result is sortet by distance. But I need to sort only by an other parameter
[19:38:51] <jan888916546465> Any Ideas :) just have a couple of hours left for the hackathon ;)
[20:01:44] <StephenLynx> >hackatons
[20:32:11] <jan888916546465> no ideas?
[22:06:33] <jan888916546465> no ideas? 2hours left :D
[22:41:45] <afroradiohead> :(
[22:43:06] <afroradiohead> I have a root user that has given another user "readWrite" role on a specific database, but that "another user" still isn't authorized to write
[22:43:15] <afroradiohead> i dun get it, anyone have an idea of why?