Closed aalfiann closed 5 years ago
Wrong thinking... You need to use some relation database like e.g. PostgreSQL. NoSQL embedded is a small file storage for small data. NoSQL embedded is targeted for simple documents, I have extended it about simple joins and scalar operations (simple
means really simple
).
BTW:
scalar
doesn't support the second value as array typeFrom docs:
database.scalar(type, [field]);
[field]
means that the argument is optionalMy expected result is ...
group
groups data according to the field
but it returns grouped fields and count of items in DB. Really I recommend to use PostgreSQL with our DBMS module: https://wiki.totaljs.com/dbms/01-welcome/
I did created CRUD but I need some report using NOSQL Embedded. I just playing arround how to convert the response into linechart which is required to group date. Actualy I have the solution already.
The reason Im not using mongodb because is too big for my current project. I will keep going to use NOSQL embedded because this is very fast. I just need more feature if available. :D
Btw, thank you, I will close this issue,
Assume that I want to create a report which is the fields is date_created, user_id, and total using scalar.
data.nosql
Here is my code:
The result is
My expected result is
My question is:
According to the documentation
Performs a scalar operation only in join() scope
, could you give me example how to create join scope with scalar if there is only one database data.nosql?How to display the Date field to the result so it will contains more information like my expected result?
I can solve this using Promise and json transform, but for big table I need the efficient or right way. So what is your solutions?
Scalar with multiple group name is not working or I just don't know how to use it?
builder.scalar('group',['channel_name','user_id']);
but the result is{}
Sorry if the question is too much, because totaljs is great framework and I want to learn more deeply. Thank you