When I log with a user the userObject contains empty customData
object despite saving a document in custom data collection pointing to the app user.
I tried to follow the documentation:
In the Users section of Mongo Stitch panel I enabled custom data. I chose database, collection (users
) and stated User ID Field
to be userId
. Then I deployed changes.
I have a created and confirmed user.
I copied the user's _id
and from shell (from admin account and context of the relevant db) I ran command db.users.insertOne({userId: ObjectId('copied_id'), description: "something"})
. It was acknowledged and when I query the collection I see relevant document with userId
field having correct ObjectId() value.
I even tried to set read rights to the users
collection.
Nonetheless, if I log in with my user, customData
object is empty. What can be the cause of this?
same issue here... pebcak :/
I fixed it by setting userId as String, not ObjectId.
Hoping it's not too late ;)