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 Query Not Generating Boolean Value #1232

Open
danbarbarito opened this issue Oct 21, 2020 · 2 comments
Open

Mongo Query Not Generating Boolean Value #1232

danbarbarito opened this issue Oct 21, 2020 · 2 comments
Labels
bug Something isn't working driver:mongodb Issues relating to the MongoBI driver help wanted Community contributions are welcome.

Comments

@danbarbarito
Copy link

Describe the bug
I am using the Vue cube.js client and I am using Mongo BI Connector as my datasource.

I have a boolean dimension in one of my cubes, but when I execute a query I get the following SQL generated:

SELECT * FROM `cube` WHERE (`cube.myBoolean` <> 'true'
	OR `cube.myBoolean` IS NULL);

Note how the value it is comparing against is 'true' and not true.

Expected behavior
I expect it to generate something like:

SELECT * FROM `cube` WHERE (`cube.myBoolean` <> true
	OR `cube.myBoolean` IS NULL);

Version:
0.21.1

Additional context
This is a huge issue for me because my MongoDB has an index on that field, and this causes my index to not work. Is there any temporary workaround I can do until this gets fixed?

@rpaik rpaik added the pr:community Contribution from Cube.js community members. label Oct 21, 2020
@paveltiunov
Copy link
Member

@danbarbarito Hey Dan! Thanks for posting this one! There's not much to do with a workaround however fix itself isn't so hard. You can pick up inspiration from https://github.com/cube-js/cube.js/blob/master/packages/cubejs-schema-compiler/adapter/BigqueryQuery.js#L20.

@paveltiunov paveltiunov added bug Something isn't working help wanted Community contributions are welcome. labels Oct 23, 2020
@danbarbarito
Copy link
Author

Thanks for the reference @paveltiunov ! Hopefully I'll find some spare time one of these days to be able to put in a fix for this. If anyone else wants to take a shot at fixing this in the meantime, be my guest 😄

@keydunov keydunov removed the pr:community Contribution from Cube.js community members. label Oct 27, 2020
@hassankhan hassankhan added the driver:mongodb Issues relating to the MongoBI driver label Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working driver:mongodb Issues relating to the MongoBI driver help wanted Community contributions are welcome.
Projects
None yet
Development

No branches or pull requests

5 participants