How to get filters to work with mongoDB connector?

Answered
ilyass aktaou asked on June 6, 2022

Hello, 
We are currently trying out FM to create a Pivot Table on one of our MongoDB collections.
Data source is configured to MongoDB connector, pivot table is working just fine but we can't seem to get filters working.
As soon as we filter out any value, result is empty as if nothing matches.
I can see on the technical specs page that filtering is available with mongoDB datasource.
Are we missing something? Is there any server side configuration to add?
Thank you
 
Update:
Looking at the aggregation pipeline generated, I can see that the match stage is wrong.

{"$match":{"daypart":{"daypart":{"$nin":["night"]}}}
// Should be
{"$match":{"daypart":{"$nin":["night"]}}

Only by using queries in filters, I can get filters to work,

5 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 7, 2022

Hello, Ilyass!

Thank you for contacting us.

We haven't managed to reproduce such filtering behavior on our side. Could you please provide us with a sample document from your MongoDB collection? It would greatly help us to continue the investigation.

Looking forward to hearing from you.

Regards,
Solomiia

Public
ilyass aktaou June 7, 2022

Hello Solomiia,

Thanks for your answer.
You can find attached a sample of 20 documents from the collection I'm currently testing on. I can also provide a screencast of the behavior with the resulting logs except that I can't attach it to the message.
Cheers,
Ilyass

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 8, 2022

Hello, Ilyass!
 
Thank you for your swift response and detailed sample.
 
We have tried to filter your sample data in our MongoDB example from GitHub and still couldn't reproduce such filtering behavior.
Please, check out the video to see all steps that we have done: https://monosnap.com/file/hUtybOyaOzmhobl31cfRTTwQNec3Um.
 
Could you provide us with your report.json file? It would be helpful to continue the investigation.
It would also be great to have your screencast. You can send it to our inbox in reply to this notification or use applications like Monosnap and provide us with the link.
 
Looking forward to your response.
 
Regards,
Solomiia

Public
ilyass aktaou June 8, 2022

Thank you for the excellent support,

It worked when I set up the handshake route, I saw it was optional in the documentation, so I skipped it initially, but filters and expands wouldn't work without it.

If you still want to explore the issue, let me know, and I'll gladly provide a screencast, but otherwise this is resolved for us.

Thank you again, you've been of great help.

Cheers,
Ilyas

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 9, 2022

Hello, Ilyass!
 
Thank you for your detailed response.
 
We are glad to hear that you managed to resolve the issue.
 
Our team has managed to reproduce similar behavior on our side. The reason for this lies in the way our MongoDB Connector handles different versions of the custom data source API.
 
For now, we recommend implementing the handshake to avoid such inconsistencies. Also, our development team will have a look at this case and make some improvements in the future.
 
You are welcome to contact us in case of any other questions.
 
Best regards,
Solomiia

Please login or Register to Submit Answer