Skip to content

Latest commit

 

History

History

mongo-datastore

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Holon platform examples: MongoDB Datastore

This is one of the Holon Platform example projects.

This example shows how to deal with the basic operations of the Datastore API, using a Mongo Datastore implementation.

Spring Boot is used for Datastore configuration, enabled by using the holon-starter-mongo-datastore starter. See the example pom.

Topics

This example addresses the following topics:

  • Automatic setup of a MongoDB Datastore using the Holon Platform Spring Boot integration
  • Management of a simple data entity using the Datastore API (create, update, delete, query)

Example structure

The Product class represents the property model for a simple product document schema.

Please note:

  • The TARGET field of the Product class is the definition of a named DataTarget which refers to the products collection name to be used with Datastore operations.

  • The TestDatastore class is a JUnit test class to show how to use the Datastore API to create, update delete and query the products, relying on the PropertyBox type to handle the property values.

Run this example

Run the unit test class using mvn test or your favorite IDE command.

Documentation

The complete Holon Platform reference guide is available here.

For the specific documentation about the components used in this example see:

System requirements

The Holon Platform is built using Java 8, so you need a JRE/JDK version 8 or above to build and run this example projects.

License

All the Holon Platform modules and examples are Open Source software released under the Apache 2.0 license.

Holon Platform Examples

See Holon Platform Examples for the examples directory.