- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 951 Articles
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
462 Views
In MongoDB to drop an index, you need to use dropIndex() method.Syntaxdb.COLLECTION_NAME.dropIndex({KEY:1})In Java, you can drop an Index using the dropIndex() method, to this method you need to pass the type of the index (ascending or descending) and the field name on which you have created it.dropIndex(Indexes.ascending("name"));Exampleimport com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
531 Views
While retrieving records from a MongoDB collection, you can limit the number of records in the result using thelimit() method.Syntaxdb.COLLECTION_NAME.find().limit(no.of records needed)The Java MongoDB library provides a method with the same name, to limit the number of records invoke this method (on the result of the find() method) by passing ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
844 Views
In MongoDB, you can view the list of databases using the show dbs command> show dbs admin config local myDatabase sampleDatabase students test testDBIn Java, you can get the list of all the databases in MongoDb using the getDatabaseNames() method.Exampleimport com.mongodb.client.MongoIterable; import com.mongodb.MongoClient; public class ListOfDatabases { public static ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
1K+ Views
While retrieving data from MongoDb collections you can select only necessary data using projections. In Java, you can project necessary data while reading the documents from a collection using the projection() method. Invoke this method on the result of find(), bypassing the names of the required filed names as −projection(Projections.include("name", ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
215 Views
While retrieving records from a MongoDB collection, you can skip records in the result using the skip() method.Syntaxdb.COLLECTION_NAME.find().limit(NUMBER).skip(NUMBER)The Java MongoDB library provides a method with the same name, to skip records, invoke this method (on the result of the find() method) bypassing an integer value representing the number of records ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
412 Views
The class ImageIcon is an implementation of the Icon interface that paints Icons from Images. You can display images on a Swing window using this class, the constructor of this class accepts a BufferedImage object as a parameter.Therefore to display an OpenCV image that is stored in a Mat object ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
337 Views
The JavaFX library provides a class with name ImageView using this you can display an image. This class accepts an object of the WritableImage class.To display an image Stored in OpenCV Mat object you need to convert it into a WritableImage object and pass it the ImageView class.Exampleimport java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
252 Views
Algorithm to convert an image to negativeGet the red green blue values of each pixelSubtract each color value from 255 and save them as new color values.Create a new pixel value from the modified colors.set the new value to the pixel.Implementation in JavaRead the required image using ImageIO.read() method.Get the ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
549 Views
In OpenCV Mat class represents a matrix object which is used to store images. You can also declare a Mat object manually −Load the OpenCV native library − While writing Java code using OpenCV library, the first step you need to do is to load the native library of OpenCV ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
2K+ Views
In OpenCV, images are stored in Using Mat object. It is nothing but an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc.If you try to read an image using the OpenCV library it will be ... Read More