Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGO sink is inserting without use config for create collection like expiration_date #2156

Closed
AlvaroVega opened this issue Apr 29, 2022 · 4 comments

Comments

@AlvaroVega
Copy link
Member

Since mongo is able to insert even if collection does not exist (then mongo creates it) create collecction methods of mongo sinks where expiration date and others are especified are not applying.

@AlvaroVega
Copy link
Member Author

Mongo sink:

(

// try insert without create database and collection before
backend.insertContextDataRaw(dbName, collectionName, aggregation);
)

STH sink

// try insert without create database and collection before
backend.insertContextDataAggregated(dbName, collectionName, lastRecvTimeTs,

Since cygnus 2.10:
[cygnus-ngsi][MongoSink][STHSink] Try to not create database and collection in each insertion (#2019, #1975)

@AlvaroVega
Copy link
Member Author

@AlvaroVega
Copy link
Member Author

My first approach to fix this issue would be delete first try-catch block

try {
// try insert without create database and collection before
backend.insertContextDataRaw(dbName, collectionName, aggregation);
} catch (Exception e1) {

Since list collection introduces the same load which try create collection each time.

@fgalan
Copy link
Member

fgalan commented May 3, 2022

Fixed in PR #2157

@fgalan fgalan added this to the release/2.18.0 milestone May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants