I am analysing a stock-index in 4-year cycles and would like to start with a base of 1 at the beginning of the first year and the calculate the returns on top, so that I get a column in the dataframe that goes 1, 1.02, 1.03, 1.025...
The return…
I am working on a project where the data is stored in a very weird shape that's causing the query for finding an user on first login attempt to TAKE A LONG TIME. I'm having a hard time wrapping my mind around how I can create an index for this. I…
since there is no R package, I have a question concerning the creation of an own function to calculate the SAPEI index - standardized antecedent precipitation evapotranspiration index ("A standardized index for assessing sub-monthly compound dry and…
I have a collection of documents storing user information as:
{
"username": "alex",
"username_1": "mark",
"username_2": "james"
}
}
I would like to ensure uniqueness both at global (throughout the whole collection) and document…
If I have a table TABLE_1 with, lets say 5 columns:
COL1 | COL2 | COL3 | COL4 | COL5
[line]
[line]
[...]
And there are two main queries I want to do:
SELECT * FROM table_a WHERE COL1 = 'X' and COL2 = 'Y'
And the other…
I have 2 queries with the same result as below:
Query 1: {
$or: [
{
field_1: "A",
},
{
field_2: "B",
},
],
field_3: "C",
},
Query 2: {
$or: [
{
field_1:…
MongoDB documentation
https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/#sort-on-multiple-fields:
For a query to use a compound index for a sort, the specified sort direction for all keys in the cursor.sort() document must match…
I've the follolowing model of a user
{
"TenantId":"abc",
"ContainerId": "xyz",
"Name": "yyy",
"Tags": [
{
"Key":"key1",
"Value":"val1".
}
.....
]
}
TenantId and containerId are in relation 1:n,…
I have trouble deciding where to best put sorting field in a mongodb compound index.
My understanding is that we need to choose the highest cardinality & selectivity as the preceeding fields in a compound index
db.person.createIndex({ rating: 1,…
Is a compound index sufficient for queries against a subset of columns ?
CREATE TABLE [FILE_STATUS_HISTORY]
(
[FILE_ID] [INT] NOT NULL,
[STATUS_ID] [INT] NOT NULL,
[TIMESTAMP_UTC] [DATETIME] NOT NULL,
CONSTRAINT…
Problem:
I'm trying to update a unique compound index on an existing data set and Mongo isn't updating the index.
Background:
In the database for our web app we have a unique compound index using a user's clubID and email. This means emails must be…
Hi can somebody explain me please how to make compound index for this simple query?
find({
"userId":{"$in":["5c778c4f52732c06d3384269","5b274b672a35d168960b1bd5","5bc43d6552732c527345c35d","58ec836e899753a22b95fb19"]},
"end":{"$gte":…
Can somebody tell me please if is possible to make indexes in Mongodb more efficient in this case: I have database with 50 millions items. There are two indexes on fields "ico" and "publishDate". Ico is used for filtering and publishDate for…