[GODRIVER-76] Document what types are allowed for BSON `interface{}` Created: 11/Sep/17 Updated: 06/Feb/18 Resolved: 06/Feb/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.1 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Samuel Rossi (Inactive) | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | GODRIVER Alpha UX |
| Description |
|
The `interface{}` type is used many places in the driver's API to accept an arbitrary BSON type or annotated struct. We should come up with standard phrasing to document this. |
| Comments |
| Comment by Githook User [ 06/Feb/18 ] |
|
Author: {'email': 'kris@mongodb.com', 'name': 'Kris Brandow', 'username': 'skriptble'}Message: Document types allowed for interface{} documents Change-Id: Icf6b137d2e5b3b0ba17061bbda558d1264eefe5c |
| Comment by David Golden [ 05/Feb/18 ] |
|
It seems odd that we'd take slices/arrays as well as "document" types in the same empty interface. E.g. InsertMany is `[]interface{}`. Ideally, we could reference a function in the `bson` package and say "anything valid for EncodeDocument" for instance and then define the specifics there, one. |
| Comment by Kristofer Brandow (Inactive) [ 05/Feb/18 ] |
|
david.golden Any suggestions on the language for this? We can accept maps, slices, arrays, structs, *bson.Document, and bson.Reader. |