-
Notifications
You must be signed in to change notification settings - Fork 2
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
No ability to specify ordered for insert many #4
Comments
Hey there! Sorry, what exactly do you mean by "there is no way to specify" this option? I think that's exactly what the |
Sorry, I can't understand where to use it. There are no arguments for collection insert_many, so the only way is to declare custom query. Bu there is only Update or Upsert. |
You implement/override this method on the type that implements the |
So I can't apply it to only one query, and only for all Doc structure? |
Yes. Doing otherwise would be surprising (in a bad way). To be clear: you specify it per document. You can still have it behave differently for different document types. But the point is that a certain document type should behave uniformly in as many regards as possible, especially in cases like insertion, which is only about the document type and it doesn't intrinsically have anything to do with some other data structure (like queries or updates would have). |
Got it. Thank you for description ;) |
No problem! |
Sorry again.
This Is it possible to use proc macro to define doc with indexes and replace function? |
This doesn't Unfortunately, there's currently no way in the proc-macro derive for |
Hello, there is no way to specify for
insert_many
ordered option: https://docs.rs/mongodb/0.3.12/mongodb/coll/options/struct.InsertManyOptions.html#structfield.orderedIt's useful, when we insert vector of data and some fields could fail on insert (for example, because of unique index). When we set ordered to false, mongodb will ignore errors and try to insert as much as possible.
The text was updated successfully, but these errors were encountered: