[JAVA-3814] Support BsonIgnore annotation for Scala case classes Created: 13/Aug/20 Updated: 28/Oct/23 Resolved: 12/Jan/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Scala |
| Affects Version/s: | None |
| Fix Version/s: | 4.2.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Gaël Ferrachat | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Goal: Add a way to ignore BSON serialization of a case class field. Context**: We don't want to store into MongoDB some case class fields (eg. computed from other sources or used for binary serialization). But we don't want (sometimes we can't) wrap them into Option (eg. to avoid things like Option[Seq[T]]).
I saw Java Driver has a BsonIgnore annotation, could it be possible to implement it ? It can cause issues for types that have no default constructor or default value but it could be prerequisite ? For example
|
| Comments |
| Comment by Githook User [ 12/Jan/21 ] |
|
Author: {'name': 'Gaël Ferrachat', 'email': 'gael-ft@users.noreply.github.com', 'username': 'gael-ft'}Message: Added Scala BsonIgnore annotation (#584)
|
| Comment by Gaël Ferrachat [ 13/Aug/20 ] |
|
Note we would like to avoid creating our own codecs and keep using Macros |