3 ways you can connect to MongoDB from WildFly – JBoss EAP

In this updated tutorial we will learn some possible ways to use MongoDB NoSQL Database from within an application server like WildFly or JBoss EAP. 1) Using the MongoDB Java Driver The most common way to connect to MongoDB from Java applications is by means of the MongoDB Java Driver which provides a simple and … Read more

MongoDB Java Driver 3.0 Quick reference

Here is a quick reference guide to MongoDB Java Driver version 3.0 How to connect to a local Database and get an handle to DB named “mydb” MongoClient mongoClient = new MongoClient(); MongoDatabase database = mongoClient.getDatabase(“mydb”); How to get an handle to the Collection named “test” MongoCollection<Document> collection = database.getCollection(“test”); How to create a Document … Read more

How to perform LIKE searches in MongoDB with Java

<p>In order to perform searches just the SQL LIKE expression you need to provide a Regular Expression.</p><p>For example, supposing you have the following Document:</p><pre class=”brush:text”>{ “_id” : { “$oid” : “5541de4243875f38bcd22ea5”} , “title” : “The Da Vinci Code” , “author” : “Dan Brown” , “type” : “thriller” , “price” : 12 , “copies” : 10}</pre><p> … Read more

Using Hibernate/JPA with MongoDB

Hibernate OGM is a framework that lets you use the power of JPA and Hibernate API with a NoSQL database like MongoDB. To make it fun, we will deploy the JPA MongoDB application on WildFly application server. First of all some basics. What is Hibernate OGM ? Hibernate Object/Grid Mapper (OGM) is a framework which … Read more

Developing applications with MongoDB and PrimeFaces on WildFly

This tutorial shows how to build an application which exports/imports data contained in a PrimFaces datatable in MongoDB.  MongoDB is a popular noSQL database which can be freely obtained from: http://www.mongodb.org/downloadsOnce downloaded, create a script named for example startmongodb.cmd (or equivalent for Linux) which starts the Mongo database, selecting a location for the storage: mongod … Read more