I've seen issues with $ prefixed fields when writing into Mongo/Document DB, I still don't get what I'm missing.
writing into collections sessions works fine:
db.updateOne(
{ _id: '32c8529b-561f-413c-a6eb-daffbdf1b1e0_google-oauth2|666666666666666666666' },
{ '$set': { _id: '32c8529b-561f-413c-a6eb-daffbdf1b1e0_google-oauth2|666666666666666666666', value: {} } },
{ upsert: true }
)
however writing into collection data fails:
db.updateOne(
{ _id: 'google-oauth2|666666666666666666666' },
{ '$set': { _id: 'google-oauth2|666666666666666666666', value: { data: [Object], revision: 76 } } },
{ upsert: true }
)
With message: 163 MongoError Name is not valid for storage
Both collections have been implicitly created, there's no extra config.
I can only guess at this point that the data (which is a 200kb JSON) contains some key that results in this? there's no $ signs in that whole JSON and most of the keys are uuids.
Any idea what's broken here?
Thanks