Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 30-05-2023 at 07:05
Please, ANSWER this question AT https://stackoverflow.com/questions/76362621/is-there-any-way-to-align-the-order-of-data-written-to-mongo-with-the-index-orde
Question:
Is there any way to align the order of data written to Mongo with the index order created by Cygnus?
Description:
I am investigating Cyguns for Fiware Orion historical data persistence.
Since Cygnus 3.0.0, indexes are created according to the data model when writing to MongoDB, but the order of the indexes created and the data written to MongoDB are different.
I tried it and found that the following indexes were created.
> db['sth_/_Car1_Car'].getIndexes()
[
{
"v" : 2,
"key" :
,
"name" : "id"
},
{
"v" : 2,
"key" :
,
"name" : "cyg_raw_opt"
}
]
However, the data written from Cygnus to MongoDB is in the following order, so it seems that the index is not valid.
> db['sth_/_Car1_Car'].find()
I checked some past Issues and found that the data was lined up in the same order as the index.(ex.https://github.com/telefonicaid/fiware-cygnus/issues/2204
What settings are needed to make this order?
My environment is as follows:
Cygnus 3.1.0
MongoDB 4.4
Thank you in advance.
2023-05-31 05:32|CREATED monitor | # answers= 0, accepted answer= False