-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Custom _id for GridFS documents #2487
Comments
@andrey-tech this sounds like a good idea! While we're tweaking @andrey-tech would you be up for a PR? |
We need this feature too! A nice improvement would be converting values to a database via mapping type.
with mapping
|
* Fix deprecation notices in CommandLogger (#2485) * Add _id and disableMD5 to UploadOptions * Improve UploadOptions * Set mongodb/mongodb: ^1.4.0 * Rename _id to id in UploadOptions, add two tests * Change prepareOptions() and test * Remove disableMD5 from UploadOptions, set mongodb/mongodb ^1.15.0 * Relax mongodb/mongodb requirements * Relax mongodb/mongodb requirements * Remove MongoDB 4.2 from testing --------- Co-authored-by: Ion Bazan <[email protected]> Co-authored-by: Andreas Braun <[email protected]>
#2489 was merged, closing here. |
Feature Request
Summary
I would like to have a way to set custom file document identifier (
_id
) for GridFS document, when I insert a new file into GridFS bucket by methodsuploadFromFile()
oruploadFromStream()
of GridFSRepository interface.This important functionality is required when migrating from MongoDB using old
doctrine/mongodb-odm
v1.x to a new MongoDB usingdoctrine/mongodb-odm
v2.x. I need to have the same document identifiers (_id
) for GridFS documents in old and new MongoDB.Used MongoDB library (
mongodb/mongodb:^1.2.0
) supports this functionality in methoduploadFromStream()
of class Bucket.I suggest to add the parameter
_id
as a new property of class UploadOptions and update methodprepareOptions()
of class DefaultGridFSRepository to support new option_id
. So, no big changes are required.The text was updated successfully, but these errors were encountered: