Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (161)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (299)

Category: MongoDB

MongoDB $multiply

Posted on February 21, 2021February 21, 2021 by Ian

In MongoDB, the $multiply aggregation pipeline operator multiplies numbers together and returns the result.

To use the $multiply operator, pass the numbers to the operator in an array.

The arguments can be any valid expression, as long as they resolve to numbers.

Continue reading →
MongoDB aggregation, operators, what is

MongoDB $subtract

Posted on February 21, 2021February 21, 2021 by Ian

In MongoDB, you can use the $subtract aggregation pipeline operator to subtract numbers and/or dates.

idickson
MongoDB aggregation, operators, what is

MongoDB $add

Posted on February 21, 2021February 21, 2021 by Ian

In MongoDB, the $add aggregation pipeline operator adds values together. Such values can be numbers, or they can be numbers and a date.

The $add operator accepts the values as arguments. The arguments can be any valid expression as long as they resolve to either all numbers or to numbers and a date.

Continue reading →
MongoDB aggregation, operators, what is

MongoDB $anyElementTrue

Posted on February 20, 2021February 20, 2021 by Ian

In MongoDB, the $anyElementTrue aggregation pipeline operator evaluates an array as a set and returns true if any of the elements are true.

If none of the elements is true, then it returns false.

An array’s element is true if it’s not false, null, 0, or undefined.

Continue reading →
MongoDB aggregation, operators, what is

MongoDB $allElementsTrue

Posted on February 20, 2021February 20, 2021 by Ian

In MongoDB, the $allElementsTrue aggregation pipeline operator evaluates an array as a set and returns true if no element in the array is false.

If the array contains an element that is false, then $allElementsTrue returns false.

An array’s element is true if it’s not false, null, 0, or undefined.

Continue reading →
MongoDB aggregation, operators, what is

5 Ways to Insert Documents in MongoDB

Posted on February 19, 2021February 19, 2021 by Ian

MongoDB provides many ways to insert documents into a collection.

Here are 5 ways to insert documents into a collection when using the mongo shell.

Continue reading →
MongoDB how to

Rename a Field in a MongoDB Collection

Posted on February 18, 2021February 18, 2021 by Ian

In MongoDB, you can rename a field when updating documents in a collection.

To rename a field, call the $rename operator with the current name of the field and the new name. This renames the field in all matching documents that have a field with that name.

Continue reading →
MongoDB how to

Import CSV Data as an Array in MongoDB using mongoimport

Posted on February 18, 2021April 28, 2024 by Ian

MongoDB’s import utility – mongoimport – introduced a new parameter that allows you to import CSV data as an array.

The --useArrayIndexFields parameter interprets natural numbers in fields as array indexes when importing CSV or TSV files.

Continue reading →
Database Tools, MongoDB arrays, how to

2 Ways to Replace a Substring in MongoDB

Posted on February 17, 2021February 17, 2021 by Ian

MongoDB 4.4 introduced nine new aggregation pipeline operators, including two new operators for finding and replacing a substring.

The two new operators that allow you to find and replace a substring are the $replaceOne and $replaceAll operators.

Continue reading →
MongoDB aggregation, how to, operators, string

4 Ways to Update a Document in MongoDB

Posted on February 14, 2021February 14, 2021 by Ian

MongoDB provides various ways to update a document. The method you use will depend on exactly how you want to perform the update.

This article presents 4 ways to update a document in MongoDB.

Continue reading →
MongoDB how to
  • «
  • 1
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • …
  • 27
  • »

About Database.Guide | Privacy Policy