[GODRIVER-1893] Add an function to validate objectID format in Go Driver Created: 22/Feb/21  Updated: 28/Oct/23  Resolved: 08/Mar/21

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 1.5.0

Type: New Feature Priority: Major - P3
Reporter: Kamiya Kenichi Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Backwards Compatibility: Fully Compatible
Documentation Changes: Needed
Documentation Changes Summary:

Add section to this method


 Description   

bson-ruby has validation method for ObjectID format as `BSON::ObjectId.legal?(string)` ref: https://github.com/mongodb/bson-ruby/blob/13c42e1ca47f47abdb15485ef5615a9189549a97/lib/bson/object_id.rb#L307-L308

I'd like to use similar feature in golang.



 Comments   
Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1893 Cleanup comments and tests
Branch: release/1.5
https://github.com/mongodb/mongo-go-driver/commit/66d98825fb5668c6a731493426510da8ba841fe2

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1893 Cleanup comments and tests
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/f93bfe2d736794cf400f287f484bdba67f78ecca

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Kenichi Kamiya', 'email': 'kachick1@gmail.com', 'username': 'kachick'}

Message: GODRIVER-1893 Add primitive.IsValidObjectID function (#592)
Branch: release/1.5
https://github.com/mongodb/mongo-go-driver/commit/b88bb74e33a8c6d1b0fa61afbe0cd98544778853

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Kenichi Kamiya', 'email': 'kachick1@gmail.com', 'username': 'kachick'}

Message: GODRIVER-1893 Add primitive.IsValidObjectID function (#592)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/5d35a1e61281647e878eb7ec8ae21dc7b9ed7fb3

Comment by Kevin Albertson [ 22/Feb/21 ]

PR: https://github.com/mongodb/mongo-go-driver/pull/592

Comment by Kevin Albertson [ 22/Feb/21 ]

Hi kachick1@gmail.com, Thank you for the feature request, and for the pull request! Someone on the team will review this soon.

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