In MariaDB, JSON_ARRAY()
is a built-in function that returns a JSON array containing the specified values, provided as arguments.
Tag: json
MariaDB JSON_TABLE() Explained
In MariaDB, JSON_TABLE()
is a built-in function that converts JSON data into a relational form.
In other words, it lets you return a JSON document as a table.
The JSON_TABLE()
function was introduced in MariaDB 10.6.0.
How to Reference JSON Keys that Contain Special Characters when using OPENJSON, JSON_QUERY, and JSON_VALUE (SQL Server)
If you’re using a T-SQL function such as OPENJSON()
, JSON_QUERY()
, or JSON_VALUE()
, you might be wary of any non-alphanumeric characters that might be in the JSON document that you’re working with. Especially if those special characters are in the key names, and you need to reference those key names.
Import Documents into MongoDB from an Array of JSON Documents
When using mongoimport
, you can use the --jsonArray
parameter to import an array of JSON documents.
How to Merge Documents when Importing a File into MongoDB
When you use mongoimport
to import files into MongoDB, you have the option of merging existing documents with the ones that you’re importing.
In this case, if an imported document has the same _id
value as an existing one in the collection that you’re importing into, the existing document will be merged with the one being imported.
You can also specify another field (other than the _id
field) to be the matching field if required.
How to Replace Existing Documents when Importing a File into MongoDB
When you use mongoimport
to import files into MongoDB, you have the option of replacing existing documents that match the ones you’re importing.
By this I mean, if an imported document has the same _id
value as an existing one in the collection you’re importing into, the existing document will be replaced with the one being imported.
You can also specify another field (other than the _id
field) to be the matching field if required.
The way to replace existing documents when using mongoimport
is to use upsert
mode.
How to Export MongoDB Query Results to a JSON File
The MongoDB Database Tools include a utility called mongoexport
that enables you to export MongoDB data to a CSV or JSON file.
One of the things you can do with this utitlity is export query results. This article shows you how to use mongoexport
to export MongoDB query results to a JSON file.
Export a MongoDB Collection to a JSON File
The MongoDB Database Tools include a utility called mongoexport
that enables you to export MongoDB data to a CSV or JSON file.
This article shows you how to use mongoexport
to export a MongoDB collection to a JSON file.
How to Select Nested JSON in SQL Server with OPENJSON
If you’re using OPENJSON()
, but you’re trying to remember how to select an inner fragment from the JSON document, read on.
How to Import a JSON File into a SQL Server Table
If you have a JSON document, there are several ways you could go about getting it into SQL Server.
If it’s a small document, you could copy and paste its contents. If it’s a larger document (or even a small one), you might want to import the whole file.
This article presents an example of importing a JSON file into a SQL Server database.
Continue reading