Skip to content
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

fix insert operation return types #398

Merged
merged 5 commits into from
Aug 14, 2023
Merged

Conversation

hazelnutcloud
Copy link
Contributor

This PR fixes the return type from insert operations. If a type was specified in the provided schema _id field, it uses that type, else it returns an ObjectId type. Before this, it returned a union of the type and ObjectId

@@ -157,16 +157,16 @@ export class Collection<T extends Document> {
docs: InsertDocument<T> | InsertDocument<T>[],
options?: InsertOptions,
) {
docs = Array.isArray(docs) ? docs : [docs];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript was complaining that the types were incompatible so had to declare a new variable

@erfanium erfanium merged commit b4f6ad8 into denodrivers:main Aug 14, 2023
5 checks passed
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.

3 participants