MorphiaOrg / MorphiaOrg/morphia

Override isStoreNulls in PropertyAnnotation

Open
#901 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

proposed
Dominant language
Java
Stars
1.7k
Forks
449
Avg merge
7m
Merged PRs (30d)
10

Description

Sometimes it can be useful to store a null value. While 99% of the time I don't, there are several times I want to null something out. It would be useful to have a field which can store/not store nulls overriding the default value of the mapper option

@Property(storeNull = true) String name;
@Property(storeNull = false) lateinit var name:String

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing PropertyAnnotation and the mapper option that controls null storage. Determine where property-level annotation values are read and how they affect persistence, then verify that both store-null and do-not-store-null overrides work without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, mongodb
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.