[SERVER-59569] Distinct is not supported in API V1 commands Created: 25/Aug/21  Updated: 01/Oct/21  Resolved: 01/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Valentin Agachi Assignee: Jacob Evans
Resolution: Won't Fix Votes: 0
Labels: query-director-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

const client = new MongoClient(uri, { serverApi: { version: '1', strict: true } });
 
await client.db(DB).collection(COLLETION).distinct('foo');

Participants:

 Description   

According to the commands listed in the API V1 commands `distinct` is not among these commands.

Commands and features outside of the Versioned API do not have the same backward compatibility guarantees as versioned alternatives.

We can use a non-strict client to use this command for now. But what is the recommendation for future proofing compatibility on applications that need to use `distinct`?



 Comments   
Comment by Jacob Evans [ 01/Oct/21 ]

The development plan is to deprecate distinct in the next few years. This will not be without providing equivalent functionality as part of an aggregation pipleine. Once this functionality is added to the newest version, it will be your best bet for future-proofing.

Generated at Thu Feb 08 05:47:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.