PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 31st of October, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[09:41:04] <OhMyGuru> hello !
[09:43:10] <OhMyGuru> I have a 300 millions collection, and no clean index to drop documents older than 90 days. Is this a good idea to remove documents based on a sort($natural:1) filter and a limit and iterate by lots ?
[13:09:22] <GothAlice> Dang, OhMyGuru isn’t around, still.
[13:10:25] <GothAlice> The answer would be: no, $natural sort and remove with limit != TTL expiry. TTL is built to not stress your server; it deletes “what it can” each minute. Which won’t necessarily be everything that needs to be deleted, but it won’t impact other operations. Might take a few periods to clean everything up.
[13:12:00] <GothAlice> Thus, https://github.com/marrow/mongo/blob/develop/marrow/mongo/core/trait/expires.py?ts=4 validates the expiry date hasn’t passed when deserializing the record, and will dynamically swap expired records for None during that deserialization. Because expired records aren’t guaranteed to not be returned.
[15:37:54] <huck5> I'm trying to come up with a Mongo query, that will retrieve only the Documents where ["fields.n.First_Name" = "Bob"], and I only want to retrieve the "fields.n.FirstName" (and _id is fine) in the results... https://gist.github.com/Huck5/0535dea161bc236a2ab1d5aa95089392
[15:38:43] <huck5> Sorry, I guess it's more like... {"fields.n" : "First_Name"} && {"fields.v" : "Bob"}
[15:39:06] <huck5> And then I need to only retrieve that specific "field" from the "fields" collection...
[15:42:55] <huck5> I've tried something like: `db.getCollection("my_collection").find({_id : 2, "f.n" : "First_Name"}, {"f.n" : 1}); , but it still keeps returning all the "fields", rather than just the field where the "f.n" = "First_Name" :/
[18:48:03] <mcerb> how can I cleaning write an updateMany query and make it use my compound index?
[18:48:13] <mcerb> I've got a database which contains movie titles and years
[18:48:55] <mcerb> I'm querying TMD for additional movie information and I want to store the tmd id for each movie I find and also add the movie if its title, year combination is not in the database
[19:14:50] <GothAlice> mcerb: Upsert. Update / insert-if-missing-then-update.