Skip to content

Fixes to type for _id in MongoDB documents return with $db.f - #223

Merged
samualtnorman merged 3 commits into
samualtnorman:mainfrom
danswann:main
Dec 29, 2024
Merged

samualtnorman merged 3 commits into
samualtnorman:mainfrom
danswann:main

Conversation

@danswann

@danswann danswann commented Dec 29, 2024

Copy link
Copy Markdown
Contributor
  • Removes boolean literal false as a valid type for _id, as attempting to insert a new document with _id:false produces the following error:
    :::TRUST COMMUNICATION::: can't have multiple _id fields in one document (2)

@danswann

Copy link
Copy Markdown
Contributor Author

Tested that all MongoPrimitve values other than null and false work as _ids, so the MongoId type should be 100% accurate to the game environment now.

@samualtnorman

Copy link
Copy Markdown
Owner

oh woops I think we both tried to work on this at the same time

@danswann

Copy link
Copy Markdown
Contributor Author

I can rebase my exclusion of false on your stuff.

@samualtnorman

Copy link
Copy Markdown
Owner

I can rebase my exclusion of false on your stuff.

yeah please, ty

@danswann

Copy link
Copy Markdown
Contributor Author

Rebased the false stuff, and also brought parity to MongoQueryId cuz that seems to work in game, i.e.:

#db.f({_id:{$oid:"12345"}});

Comment thread env.d.ts Outdated
@samualtnorman
samualtnorman merged commit 412ee2f into samualtnorman:main Dec 29, 2024
samualtnorman pushed a commit that referenced this pull request Dec 30, 2024
* The literal `false` gives an error when used as `_id`

* Allow querying `_id` with full `#db.ObjectId` structure

* Typo fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants