MorphiaOrg / MorphiaOrg/morphia

Mapping nested objects to property using dot notation

Open
#978 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

Hello,

This is a feature request.

When mapping documents to POJO's, it would be nice to use the @Property annotation to map nested documents using dot notation. For example;

Document

{
    name: "morphia",
    meta: {
        version: "1.1.1"
   }
}

POJO

class Document {

    private String name;

    @Property("meta.version")
    private String version;
}

This would avoid having to model deeply nested documents with a lot of boilerplate code.

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

The issue names no files, tests, or entry points. Start by locating the @Property mapping implementation and existing nested-document mapping behavior, then determine where dot-notation paths are resolved. Done means a POJO field annotated with @Property("meta.version") receives the nested document value without requiring an intermediate model.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.