solarsquick question: I have a db+user where access works from a remote machine, and a similar setup where it doesn't - there must be something with the user or collection config. Is there a table where IPs or something like that are specified?
solarsI think it's something different - the old users were created before the SCRAM-SHA-1 update. Is there a way to switch users back to MONGODB-CR?
salty-horseI'm using pymongo. is there a reason why the default uuid representation is "LEGACY" (bson BinData type 3, deprecated) rather than 4? if I have a fresh database, should I only save type 4?
Derickyes, store type 4
Derickthe default is 3 as we didn't want to break people's code
Dericksalty-horse: see also the notes at the bottom of http://bsonspec.org/spec.html
salty-horseDerick, the notes were very vague as to what I should choose, both in the bson spec and pymongo. I'll use type 4. thanks!
Derickfair enough
sweet2k4l
sweet2k4I'm looking to build a database structure similar to a Multi level marketing system. one user can invite friends and those friends can invite more friends which are credited to the first user. id like some input to how to approach this
TrezkerI'd go with each user having a reference to the user that invited them
TrezkerI think that makes a lot of tasks simpler
sweet2k4Trezker: then how would I track the first user when its a million ppl down the line?
Trezkerwhat do you mean by track?
sweet2k4I mean, lets say the first users has invited some friends, which in turn has invite more of their friends. I want to give all individual users a log of how many users in total hes initial invites has resulted in
sweet2k4his*
Trezkerhttps://stackoverflow.com/questions/48412571/count-recursively-on-a-collection-in-mongodb
sweet2k4Trezker: ahh i see so aggregation query could be the answer?
TrezkerI think so
sweet2k4Trezker: thanks il take a closer look at that
leshaqeHello everyone! I am looking for a quick hint in the right direction: I created an array in a project stage with the help of a filter operator. I try to create another field that holds the amount of items in this array. But I get an error: "The argument to $size must be an array, but was of type: missing" Is it because it's in the same project stage?
sweet2k4hmm why do I get users not defined with this: db.users.aggregate([ {"$match":{"_id":"1"}}, {"$graphLookup":{ "from":users, "startWith":"$_id", "connectFromField":"_id", "connectToField":"parentId", "as":"children" }}, {"$project":{"total_children":{"$size":"$children"}}} ])
sweet2k4if I have sharded database, does my collection automaticly get sharded?
sweet2k4The collection specified in from cannot be sharded.
Catatronicsay i have a bit of data that looks like this { "charges": [ {"date": "...", "release": "..."}, {"date": "...", "release": "..."} ]
Catatronichow do i insert a new {"date": "...", "release": "..."} in to the charges array without clobbering the old entries?
TrezkerCatatronic, https://docs.mongodb.com/manual/reference/operator/update/push/
CatatronicTrezker, thank you!
Catatronici went through the getting started docs several times.. i forgot there was an actual manual.
Catatronicyou pulled me back from the brink of insanity. jk though, mongodb has been rather enjoyable.