-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert document via MongoClient, the value of AnyBSON(Date) will be transferred to Timestamp @ v10.0.0-beta.2 #6654
Comments
Same issue. Passing Foundation.Date object into AnyBSON.datetime( ) stores the document in Atlas with a timestamp value, which cannot be read by the realm client -> "Object was deleted or invalidated". I've spent about 5 hours now trying to sort this out and can't find any documentation. This is the closest hit yet and it was posted almost 5 months ago...? |
@ananfang this is the expected behaviour, as the BSON speciation states:
|
@homathko can you share your MongoDB Realm schema & Swift object with us so we can investigate? |
I wish I could! This was awhile ago and is out of my scope now - I am having trouble recalling any details. It was working with cloud functions and custom user data, so this probably isn't the place for further troubleshooting anyhow.. |
@leemaguire |
Fixed by #7062 |
Goals
Using the app.mongoClient to insert the document, the value of AnyBSON(Date) will be transferred to Timestamp in MongoDB, and even the timestamp is wrong.
Expected Results
It should be recorded as the Date type in the MongoDB.
Actual Results
The field "updatedAt" will be the type of Timestamp, and the value will be always different.
(e.g. 6850268160453509127, 6850268302187429898 and etc., extremely big and obviously not timestamp number)
Steps to Reproduce
Check Actual Results
Code Sample
Check Actual Results
Version of Realm and Tooling
Realm framework version: v10.0.0-beta.2
Realm Object Server version: MongoDB Realm
Xcode version: 11.5
iOS/OSX version: 13.5 (simulator)
Dependency manager + version: CocoaPods 1.9.3
The text was updated successfully, but these errors were encountered: