In MongoDB you can use the $isArray
aggregation pipeline operator to check whether or not a value is an array.
It accepts any valid expression, and returns true
if the expression is an array, false
if it’s not.
In MongoDB you can use the $isArray
aggregation pipeline operator to check whether or not a value is an array.
It accepts any valid expression, and returns true
if the expression is an array, false
if it’s not.
In MongoDB, the $indexOfArray
aggregation pipeline operator searches an array for an occurrence of a specified value and returns the array index of the first occurrence.
In MongoDB, the $arrayToObject
aggregation pipeline operator converts an array to a document.
In MongoDB, the $objectToArray
aggregation pipeline operator converts a document to an array.
In MongoDB, the $reverseArray
aggregation pipeline operator reverses the order of items in an array.
It accepts an array expression as an argument and returns an array with the elements in reverse order.
Continue readingWhen using mongoimport
, you can use the --jsonArray
parameter to import an array of JSON documents.
In MongoDB, the $concatArrays
aggregation pipeline operator concatenates two or more arrays and returns the concatenated array.
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.
In MongoDB, you can use the $push
operator to append a value to an array.
This operator can be used with various modifiers, one of which is the $position
modifier. The $position
modifier allows you to specify the position within the array that you want to insert the new value.
In MongoDB, the $arrayElemAt
aggregation pipeline operator returns the element at the specified array index.
It accepts two arguments;