If you’re getting a “longitude/latitude is out of bounds” error when trying to create a 2dsphere index in MongoDB, it could be due to your longitude and latitude coordinates being in the wrong order.
Continue readingTag: how to
8 Ways to Add Days to a Date in MariaDB
MariaDB provides several ways to add a certain number of days to a given date. For example, you might want to add 10 days to a date, or 30 days, or even just 1 day. Fortunately, MariaDB makes this easy.
Here are 8 ways to add a number of days to a given date in MariaDB.
Continue readingHow to Check Whether an Index is Hidden in MongoDB
From MongoDB 4.4, it’s possible to hide an index from the query planner. This allows you to evaluate the potential impact of dropping an index without actually dropping the index.
You can use the getIndexes()
method to check whether or not an index is hidden. If an index is hidden, that index will display a hidden
field as having a value of true
(i.e. "hidden" : true
).
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.
3 Ways to Hide an Index from the Query Plan in MongoDB
Starting from MongoDB 4.4, we can now hide indexes from the query plan. This enables us to evaluate the potential impact of dropping an index without actually dropping the index.
If hiding it has a negative impact, we can unhide the index. This saves us from having to drop the index, then recreate it again.
Below are 3 ways to hide an index in MongoDB.
Continue reading3 Ways to Return Distinct Values in MongoDB
Distinct values are those values with redundant duplicates removed. In other words, distinct values are unique values.
In MongoDB there are a few ways we can return distinct values in a query. This article presents 3 ways to return distinct values in the mongo shell.
Continue readingChange the Password for a SQL Server Login
This article demonstrates how to use T-SQL to change the password for a SQL Server login.
You can change the password for another login (assuming you have the appropriate permissions), or you can change it for your own login. This article outlines both of these scenarios.
Continue reading3 Ways to Drop an Index in MongoDB
MongoDB provides several ways to drop an index or indexes.
To drop a single index, you can use the dropIndex()
method.
To drop multiple indexes, you can use either the dropIndexes()
method or the dropIndexes
administration command.
How to Set MariaDB to use Vertical Output
If you connect to MariaDB using the command line interface, you might sometimes find that your query results are too wide, due to the number of columns being returned, and the data they contain.
Continue readingHow to Truncate Text with an Ellipsis in MariaDB
Sometimes you might find that the amount of text returned in a database column is too long. You might just want to return a short snippet of that text, followed by an ellipsis or three dots.
Fortunately, this is relatively easy to do in MariaDB.
Continue reading