How to use skip() method in MongoDB

In MongoDB, we can limit the number of documents that we want by using limit() method. This method takes one number and returns only that number of documents. Similar to limit(), we also have another method called skip() to skip the starting values. This method is defined as below :.

Read

How to use limit method in MongoDB with examples

In this tutorial, we will learn how to use the limit() method in MongoDB with different examples. limit() method is used to fetch only a specific number of documents. This method takes one number, i.e. the number of documents that you want to fetch. You can use it on find().

Read

How to change the port of a mongod instance

Sometimes you may need to change the port of mongod instance running in your system. The default port is 27017 and it is used by default if you are running mongod. This port is used by both mongod and mongos instance.

Read

How to trim a string in JavaScript with examples

Trimming is used to remove whitespace characters from a string. Javascript provides us different methods to remove whitespaces from the start, end and both sides of a string. Whitespace is any whitespace character like tab, space, LF, no-break space, etc.

Read

JavaScript substr() function explanation with example

The substr function is used to get one substring from a string in Javascript. In this example, we will learn how to use the substr method in Javascript with examples.

Read

C++ program to find the second highest number in an array

In this tutorial, we will learn how to find the second-highest number in an array in C++. The program will take the array elements as input from the user. It will then find out the second-highest element and print it out.

Read

C++ program to find the power of a number

In this tutorial, we will learn how to find the power of a number in C++. We can use one loop to find the power or C++ provides one method called pow() to find the power.

Read

Python program to check and create one directory

Python OS module provides different methods to perform different operating system tasks like create a directory, delete a directory, etc. In this post, we will learn how to check if a directory exists or not and to create one directory if it doesn't exist.

Read

C++ example program to reverse a number

In this tutorial, we will learn how to reverse a number in C++ using one loop. We will use one while loop to reverse the number. The program will read the number as input from the user, reverse it and print it to the user.

Read

How to add comments in C++ with example

Comments are important. It makes the code more readable. Comment is supported in all programming languages. In C++, comments are categorized into two types. In this tutorial, I will show you how to write comments in a C++ program. Always try to write comment in your code. It is a good development practice.

Read