can we Fetching multiple MicroStrategy objects at once with filtering capability like Query Builder? - query-builder

In General, I used to parse MicroStrategy Document ID for getting the list of Documents in the corresponding Id, so
How can I use any Query instead of parsing ID?
I sit possible in Microstrategy?
If yes can someone suggest me the approach?

Related

Should GraphQL offer a single item query in addition to the list query?

In our application we offer list queries with sorting and filtering and now we were discussing if we should also offer single item queries with the id as parameter.
I've googled a bit and found that very often both queries, list and single item, are implemented.
I'm just wondering why. Wouldn't/Shouldn't a single item query with id as parameter be the same as a list query filtered for id? In both cases the UI should be able to select all properties throughout the graph, right?
Why would the backend care to offer a single item query when the list is already sufficient?
Looking for best practices here.

strapi - fetch data to enumeration field and select multiple values

I need to add a multiple select field (as a component or many to many relation) to the collection type.
But I want to fetch data from an external API and show it in the dropdown.
can I know how to achieve such kind of implementation?
because strapi won't allow fetching data to a collection type field from external API
Strapi as at the time of answering this question does not allow multiple selections for an enumeration field.
The possible way I would recommend is creating the Content-type field as a JSON. Then in your backend controller, you do the checking before validating the data.

Spring JPA Derived query method groupBy

Hi I was building an app and was wondering on how I can convert this query into a derived query method without using the annotation #Query:
SELECT address, COUNT(*) address FROM `employee` GROUP BY address ORDER BY address DESC LIMIT 5
I have tried it here is how I did it
List<Employee> countByAddressGroupByAddressByOrderByAddressDescLimit5();
This throws the following error
Invalid derived query! No property groupByAddressBy found for type String! Traversed path: Employee.address.
I was wondering if what am I doing wrong here thank you in advance.
I don't think query derivation supports group by.
You can't.
Derived queries don't support GROUP BY.
Derived queries are intended only for simple queries, where the mapping between a normal method name that you might choose independently from Spring Data and the query needed for implementation is obvious.
For more complex cases like the one you describe other mechanisms are available, like annotated or named queries. Nobody wants to use a method name like countByAddressGroupByAddressByOrderByAddressDescLimit5 anyway.
As others said, derived queries do not support this. There might be other reasons besides simply not being a 'practical' solution.
AFAIK derived query methods are restricted to retrieving instances just for the entity type managed by the repository (you can retrieve MyEntity, Optional<MyEntity>, Collection<MyEntity>, etcetera) or projections that match the fields/columns used for the managed entity.
When you use 'Group By', you break with this resultset structure, you usually have to explicitly indicate which columns you want to retrieve or which operations you want to perform on the grouped columns (which would be impossible using just a method name).
TL;DR
You can't easily indicate the columns you want to include in a 'Grouped By' query result, so no, I don't think there is a way to use this technique with 'Group By'.

How implement join queries in parse.com javascript?

I am new on parse server ( parse.com ). I have two classes "students_records" and "students_fee". I am storing fee records in class "students_fee" with objectId of "students_records" in column "student_id". Now I want to collect records from both classes by one query similar to join query we do in mysql with base on column 'fee_year' in class "students_fee". for example get all students who have 'fee_year'=2016 and 'student_id'=objectId of "students_records", this is link https://parseplatform.github.io/docs/js/guide/ of guide I am currently getting help, but i can't find such thing. Can anyone tell me how to do that?
Thanks.
Since parse use MongoDB (NoSQL) behind the scenes there is no real "join". What you can do is to create a array relationship from students to records and then use include in your query in order to include all the records under a student.
You can read more about it here.
I recommend you to use Parse SDK's here in order to keep it simple.
the Parse SDK is available for all the popular programming languages (e.g. iOS, Android, PHP, JavaScript and more)

"Join query" in ElasticSearch

Let's say we have two index types: members and restaurants. Both contain city attribute.
I want to filter members (e.g. by name) and would like to include list of restaurant names from the members' hometown/city in the results.
Is it possible to do this using just one ES query? I guess it should be similar to DB join.
Thanks.
ES doesn't have the concepts of joins. This is due to it being an index rather than a relational database. Your best best to make two calls. One to get the member's documents, then another to get the restaurants.
Unless you have odd circumstances, this should still be very efficient.

Resources