[JAVA-1325] Implement new API for queries and updates for async MongoClient Created: 31/Jul/14  Updated: 04/Nov/16  Resolved: 17/Nov/14

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: None
Fix Version/s: 3.0.0

Type: New Feature Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-1526 More codec/generic support Closed
Epic Link: Async

 Description   

Bring async client API in line with sync client API.



 Comments   
Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Updating the rxJava API to mirror the async API

JAVA-1325
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2cbb197e43454c2f0a87183ae2c4be77659328ad

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Updating the Async API to mirror the sync API

JAVA-1325

Conflicts:
driver/src/main/com/mongodb/FindFluentImpl.java
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/ea546524078c6b907bebbca91d21fe9076b2ac73

Comment by Nick Scavelli [ 18/Nov/14 ]

How does one do a findOne with the new API ?

Comment by Nick Scavelli [ 18/Nov/14 ]

Ahh ok, I guess I was looking at the legacy stuff (DBCollection). I haven't really looked at the sync stuff yet.

Comment by Ross Lawley [ 18/Nov/14 ]

Thanks nscavell for the comments.

I'm sorry to drop such a large change to the old sync api - but now we should be fully up to date and we will work to keep them in sync, now the api's are being finalised.

Why no save? For a couple of reasons, but primarily because it doesn't do what people wanted or expect and as such it has caused users a number of issues. Replacing the whole document rather than using atomic updates is generally not what users wanted and as such it was decided it would not be implemented in new crud api - which is being bought out across drivers.

executeCommand result type - good catch, I've added JAVA-1561 and JAVA-1562 to cover two places where we've missed the possibility of returning a custom type.

Differences to the shell for delete / remove - Sync and Async should mirror, so they both have deleteOne and deleteMany. The plan for the shell is to be updated and to reflect the drivers and the crud api - although that is likely to happen post 2.8.

Comment by Nick Scavelli [ 17/Nov/14 ]

Another comment: s/delete/remove. Wouldn't this be more consistent with the sync and shell remove operations ?

Comment by Nick Scavelli [ 17/Nov/14 ]

Another comment: Support for codec for executeCommand on MongoDatabase (I can create separate JIRA's, but just wanted to file them here for now until a +1)

Comment by Nick Scavelli [ 17/Nov/14 ]

Awesome, first comment: Why no save ?

Comment by Githook User [ 17/Nov/14 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Updating the rxJava API to mirror the async API

JAVA-1325
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/2cbb197e43454c2f0a87183ae2c4be77659328ad

Comment by Githook User [ 17/Nov/14 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Updating the Async API to mirror the sync API

JAVA-1325

Conflicts:
driver/src/main/com/mongodb/FindFluentImpl.java
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/ea546524078c6b907bebbca91d21fe9076b2ac73

Comment by Nick Scavelli [ 06/Nov/14 ]

So I see this marked as 3.0 desired, but I don't really see how the async client API can be used effectively with a custom codec. Any way I can help move this forward ?

I'm finding out that update and replace on upsert generates an ObjectId because it uses the DocumentCodec instead of my custom CollectibleCodec.

Generated at Thu Feb 08 08:54:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.