How the arrayFilters Parameter Works in MongoDB

In MongoDB, when you update documents that contain arrays, you have the option of using the arrayFilters parameter.

The arrayFilters parameter allows you to specify an array of filter documents that determine which array elements to modify.

In the update document, use the $[<identifier>] filtered positional operator, which identifies the array elements that match the arrayFilters conditions for the update operation.

Continue reading

JSON_ARRAY_APPEND() – Append Values to a JSON Array in MySQL

When using JSON documents with MySQL, we can use the JSON_ARRAY_APPEND() function to append new values to an array.

The way it works is, you provide the JSON document as the first argument, then follow that up with the path to append to, followed by the value to append.

In MySQL 5.7, this function was called JSON_APPEND() but that name is no longer supported.

Continue reading