[SERVER-51369] Add "variant" type to IDL syntax Created: 05/Oct/20  Updated: 29/Oct/23  Resolved: 28/Jan/21

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

Type: Task Priority: Major - P3
Reporter: Samyukta Lanka Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-52542 Specify input/output to dropIndexes c... Closed
Duplicate
is duplicated by SERVER-40521 Add multi-type IDL types to the IDL p... Closed
Related
related to SERVER-53150 Specify input/output to isMaster/hell... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2021-01-11, Repl 2021-01-25, Repl 2021-02-08
Participants:

 Description   

This new type represents a union of multiple types. For example:

structs:
  writeConcern:
    fields:
      w:
        type:
            # The "w" field accepts a string or an int
            variant: [string, int]

Add tests for the "variant" type in test_parser.py and test_generator.py, following the examples of the existing types.



 Comments   
Comment by Githook User [ 28/Jan/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-51369 Generate C++ for IDL variants
Branch: master
https://github.com/mongodb/mongo/commit/fd5d916299823608161ebf2473a17b58ddf14b5b

Comment by Githook User [ 25/Jan/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-51369 IDL parser/binder changes for variant types
Branch: master
https://github.com/mongodb/mongo/commit/e37f5e4c1cb9618892c2ee42c67e56bacc2325ff

Comment by Githook User [ 15/Jan/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-51369 Separate fields from types in IDL compiler
Branch: master
https://github.com/mongodb/mongo/commit/ac682eab41a10d2824d2f156c61e534a7d604410

Comment by Githook User [ 11/Jan/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-51369 Begin IDL "variant" type
Branch: master
https://github.com/mongodb/mongo/commit/5366d249622abe86298901e1b7bbfb16c2b3dcfd

Comment by A. Jesse Jiryu Davis [ 05/Jan/21 ]

Consider redefining "writeConcernW" in terms of variant, once we add the variant IDL feature.

Comment by A. Jesse Jiryu Davis [ 05/Jan/21 ]

Actually, dropIndexes seems to require a variant type in order for us to express it in IDL. Its "indexes" field can be a string, array of strings, or a document.

Comment by A. Jesse Jiryu Davis [ 13/Oct/20 ]

We decided during the design process that we don't need this IDL enhancement.

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