GithubHelp home page GithubHelp logo

spring-projects / spring-data-mongodb Goto Github PK

View Code? Open in Web Editor NEW
1.6K 170.0 1.1K 33.01 MB

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.

Home Page: https://spring.io/projects/spring-data-mongodb/

License: Apache License 2.0

Java 98.13% JavaScript 0.01% Kotlin 1.79% Dockerfile 0.08%
ddd java mongodb spring spring-data framework

spring-data-mongodb's Issues

Support for map-reduce operations in MongoTemplate [DATAMONGO-7]

Mark Pollack opened DATAMONGO-7 and commented

The use of MapReduce via the driver is cumbersome, provide a layer that exposes map reduce operations with type-safe helper objects.

Investigate: http://cookbook.mongodb.org/ lists a few common cases where one would use map-reduce, typically to sort/count document array elements. See how this might be better packaged up so as to avoid Java users from having to write JavaScript/MapReduce for common tasks


Issue Links:

  • DATAMONGO-182 add 'group' and 'mapreduce' to the MongoOps
    ("Cloned from")

1 votes, 1 watchers

Rich object mapping support [DATAMONGO-50]

Jon Brisbin opened DATAMONGO-50 and commented

We should incorporate code from the spring-data-mapping project (formerly Grails' inconsequential) to support rich mapping in the MongoDB support.

Things we'll need to address include:

  • Implementing the right MappingContext and MappingConfigurationStrategy objects to read an object's annotations and configure the mapper appropriately.
  • Saving and reading child collections in case of relationships.
  • Implementing a special MongoConverter class to handle reading and writing objects

Affects: 1.0 M1

Sub-tasks:

Id property is overridden by Spring Data's own Id property [DATAMONGO-44]

Mark Serrano opened DATAMONGO-44 and commented

When creating a simple POJO with an id property and persisting this object to MongoDB, the id property is overridden by Spring Data. It merges the "id" with "_id".

For example:
{ "_id" : "69133244-fcc0-42b2-aa59-308f00c75860", "firstName" : "John", "money" : 1000, "lastName" : "Smith" }

{ "_id" : "45d236ff-6a38-4767-a973-6f3d70ff2448", "firstName" : "Jane", "money" : 2000, "lastName" : "Adams" }

{ "_id" : "9dcba269-9ed5-45c6-887e-a2de8fec334d", "firstName" : "Jeff", "money" : 3000, "lastName" : "Mayer" }

The native MongoDB preserves both the "id" and "_id", while Spring Data combines both as "_id". As a workaround, I have to rename my POJO's id property as "pid" (any other name will work).

For example:
{ "_id" : ObjectId("4d5e7b3bfdece02281f253a4"), "id" : "f1e6b8b2-9d68-495c-9d6e-b81cc35cf9bc", "firstName" : "John", "lastName" : "Smith", "money" : 1000 }

{ "_id" : ObjectId("4d5e7b3bfdece02282f253a4"), "id" : "39f6ebfb-10cf-4702-a5b8-8bc2489cebcc", "firstName" : "Jane", "lastName" : "Adams", "money" : 2000 }

{ "_id" : ObjectId("4d5e7b3bfdece02283f253a4"), "id" : "f4932004-c320-47e4-b4b3-7d07f3aaabb9", "firstName" : "Jeff", "lastName" : "Mayer", "money" : 3000

See the following tutorial that shows this "pid" workaround: http://krams915.blogspot.com/2011/02/spring-data-mongodb-tutorial.html

See the following tutorial that uses native MongoDB which correctly preserves both "id" and "_id": http://krams915.blogspot.com/2011/01/spring-mvc-3-using-document-oriented.html


Reference URL: http://forum.springsource.org/showthread.php?p=346693&posted=1#post346693

Issue Links:

Extract MongoOperations from MongoTemplate [DATAMONGO-25]

Oliver Drotbohm opened DATAMONGO-25 and commented

We should introduce a MongoOperations interface for the functionality provided in MongoTemplate to decrease the coupling of potential clients (e.g. the repository abstraction) and align to all other Spring templates that follow that guideline.

It's probably a good idea to do this while polishing the JavaDoc as well


Affects: 1.0 M1

Issue Links:

  • DATAMONGO-18 Extract common MongoTemplate methods into MongoOperations interface
    ("duplicates")

Validation support to MongoTemplate [DATAMONGO-36]

Mark Pollack opened DATAMONGO-36 and commented

Spring 3.0 supports JSR-303. If

<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
is defined, we can ask the container for the validator (is there an Aware interface?) and then perform validation within MongoTemplate methods that take a POJO for Create, update, or delete operations.


Affects: 1.0 M2

Attachments:

Referenced from: commits 5b13307

1 votes, 3 watchers

Add support for specifying attributes to entities, e.g., collection name, field names, etc. [DATAMONGO-40]

Oruganti Shanker opened DATAMONGO-40 and commented

Need to be able to specify the collection name for each repository. The collection name used for each entity should be specifiable as an annotation, e.g., the Table annotation.

Another important enabler for using spring-data-mongo in production code is to add a few annotations which have similar functionality to the @Reference, @Embedded etc. in Morphia, and for naming the fieldnames in the persistence store differently from the fieldnames used in the Java Entity. Of course these annotations should be consistent with JPA annotations, and should be a superset of JPA annotations.

See the thread http://forum.springsource.org/showthread.php?t=102127 in the Forum


Attachments:

1 votes, 2 watchers

SimpleMongoConverter could support identifying Spring EL expressions in keys [DATAMONGO-32]

Oliver Drotbohm opened DATAMONGO-32 and commented

Besides plain JSON array hierarchies the SimpleMongoConverter could support Spring EL expressions for keys such as:

{"parameters.p1" : "1" , "count" : 5.0}

Need to discuss, how to detect Spring EL in this case. We could simply forbid dots in plain keys and treat every key containing a dot as Spring EL or enforce concrete EL delimter usage #{...}


No further details from DATAMONGO-32

Sample application(s) [DATAMONGO-29]

Mark Pollack opened DATAMONGO-29 and commented

Sample applications sit in a separate repository but should be sync'd with the M1 release.
Two types of examples are important to show

  1. Generic Repository data access (CRUD) on some domain object
  2. Specific features of MongoTemplate that highlight typical MongoDB use cases, such as partial update.

Existing apps show

  1. Spring MVC analytics
  2. Collection of file system information

Could look into music play-list style application or use of Restaurants domain from Chris Richardson's POJOs in action as much has been done in neo and couchdb to support that domain


No further details from DATAMONGO-29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.