[CXX-1880] bsoncxx::element::array does not expose key() function Created: 16/Nov/19  Updated: 28/Oct/23  Resolved: 20/Apr/20

Status: Closed
Project: C++ Driver
Component/s: BSON
Affects Version/s: 3.4.0
Fix Version/s: 3.6.0-rc0, 3.6.0

Type: Improvement Priority: Major - P3
Reporter: Rohit Vishwakarma Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 1.cpp    
Backwards Compatibility: Fully Compatible

 Description   

I'm currently writing generic template function that will recursively serialize and deserialize the object from document::element. Everything works fine until it encounters an array field.

array::element currently inherits document::element, therefore important function key() is not available to check field name before deserializing. 

Please see the code comment line#6.



 Comments   
Comment by Kevin Albertson [ 20/Apr/20 ]

array::element now includes the missing key() function.

Comment by Githook User [ 20/Apr/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-1880 expose key on array element
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/feede972a3fe0be8972ba4db9665a385c0a7bba9

Comment by Kevin Albertson [ 17/Apr/20 ]

Hello inbox.rohitv@gmail.com. Thank you for reporting, and my sincere apologies for the very long delayed response. I believe not exposing the key() function on bsoncxx::array::element was an oversight on our part, and should be resolved in an upcoming release.

Thank you,
Kevin

Generated at Wed Feb 07 22:04:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.