How to Sort MongoDB Query Results using Java

Introduction When you query a MongoDB database, you may want your results to be returned in a certain order. Let’s imagine you have a collection of student names in your database– perhaps you’d like to have them returned in alphabetical order, or maybe you want the results returned sorted by age. No matter what your … Continued

How to Perform Aggregation in MongoDB using Java

Introduction When you query MongoDB for data, there may be times that you want to group your results and provide metrics such as total counts or averages. In these cases, you’ll want to use aggregation to accomplish the task. Fortunately, aggregating MongoDB documents in Java is a simple process, and the examples we provide will … Continued

How to Update a Document in MongoDB using Java

Introduction Updating documents is a common task in database management. You might want to update a single document, or you may need to update a number of documents that meet some specified query criteria. Regardless of the exact requirements, it’s easy to update MongoDB documents with some simple Java code. In this article, we’ll provide … Continued

How to Delete a Document in MongoDB using Java

Introduction When you’re working with a database like MongoDB to store and manage your data, there will be times you need to delete certain documents. It’s important to know how to do this correctly, since deleting a document is a permanent action. Fortunately, it’s easy to accomplish this task with Java. In this article, we’ll … Continued

How To Index A PDF File As An Elasticsearch Index

Introduction Oftentimes, you’ll have PDF files you’ll need to index in Elasticsearch. The attachment processor Elasticsearch works hard to deliver indexing reliability and flexibility for you. To save resources in the process of indexing a PDF file for Elasticsearch, it’s best to run pipelines and use the ingest_attachment method. Both techniques play a large role … Continued

How to Configure MongoDB Database Profiling using Java

Introduction If you’re using MongoDB to store and manage your data, it’s important to keep the database running as efficiently as possible. The MongoDB database profiler can help you accomplish this by identifying slow operations and queries. With this information in hand, you can make changes to boost your database’s performance, such as rewriting slow … Continued

How to Limit the Query results in MongoDB using in Eclipse using Java

Introduction If you’re a Java developer working with MongoDB, it’s important to know how to create different queries in order to get the results you need. Normally, a MongoDB query performed using Java will return all matching results; however, there may be times when you need to limit your results to a specific number. Fortunately, … Continued

Elasticsearch Cheatsheet of Kibana Console Requests

Introduction The Kibana Console UI is an easy and convenient way to make HTTP requests to an Elasticsearch cluster. It’s not difficult to get started with Kibana: Just make sure that the Kibana service is running, and navigate to it on your server (the default port is 5601). Go to the Dev Tools section (if … Continued

Inserting a Document in MongoDB Using JAVA

Introduction MongoDB stores documents in BSON form. All of the documents in MongoDB are a record that is a data structure made up of fields and value pairs. MongoDB documents are comparable to JSON objects and the values of fields can include other documents and/or arrays of documents. Just as you use JSON like structure … Continued

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.