[JAVA-5129] Can CRUD method options be specified as a BSON document? Created: 31/Aug/23  Updated: 01/Sep/23  Resolved: 01/Sep/23

Status: Closed
Project: Java Driver
Component/s: Aggregation
Affects Version/s: 4.9.0
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: chaoyang jia Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-08-31-22-27-16-976.png    
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

When using pipeline functions, options cannot be customized and can only be done through the provided methods. If I have seen options written to BSONDocument, they cannot be passed in. Is there a way to pass them in?



 Comments   
Comment by Jeffrey Yemin [ 01/Sep/23 ]

No, there is not a way to specify options via a BSON document, nor do we have any plans to add such functionality. As a workaround, you could write a simple helper method that translates your options into method calls on AggregateIterable (we do a similar thing in one of our test harnesses).

Comment by chaoyang jia [ 31/Aug/23 ]

I am using a pipeline, MongoCollection. aggregate (pipeline), but my options parameter is a BasicDBObject object. I cannot give options to the aggregate method, can I only use some of the options methods you provide? Methods such as comments

Comment by chaoyang jia [ 31/Aug/23 ]

this is my code

Comment by PM Bot [ 31/Aug/23 ]

Hi j15030047216@163.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:03:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.