Delete rows in CloudBoost using conditions - cloudboost

Is there a quick way to delete rows in a CloudBoost database without sending an ID as parameter?
For example, imagine that I have a list of Dogs and would like to delete those whose color is white.
Looking in the documentation, I could create a CloudQuery to retrieve all Dogs that matches this condition and then call CloudObject.deleteAll to remove all of them. The problem in this solution is that I needed to retrieve all the data to be able to remove them.
Is there any straightforward solution for this problem to avoid making unnecessary requests to the server?

currently, cloudboost has no option like this that you are looking for. To delete you have to first fetch cloudobjects then deleteall(). Anyway, you can contact cloudboost team and request for this feature. I am sure they will help you out on this.

Related

ServiceNow Rest API (using PowerBI)

I'm on a project in which I need to get data from a ServiceNow instance and treat all data with PowerBI. I'm able to retrieve a big amount of data (Snow collect a lot of data), but I still need a way to filter data correctly. I'm calling to this URL:
Besides, I want also to apply a filter to retrieve just some specific registries from the table Requested Items. For that, I use the sysparm_query parameter to filter the field "cmdb_ci" and more specifically it's "name", something like:
&sysparm_query=cmdb_ci=What I need to Filter
Apart from this, I have also tried:
&sysparm_query=cmdb_ci.value=What I need to Filter
&sysparm_query=cmdb_ci.display_value=What I need to Filter
&sysparm_query=cmdb_ci.sys_id=What I need to Filter
&sysparm_query=cmdb_ci.name=What I need to Filter
But still not found the solution... as all these does not respond the solution needed.
Does someone know how I can manage this?
Thanks!!
JLG
There are two "Configuration item" fields in sc_req_item: cmdb_ci and configuration_item. Make sure that you are using the correct one. Either cmdb_ci.name=value or configuration_item.name=value should work, depending on which of the two fields you are using. cmdb_ci.value and cmdb_ci.display_value will not work as there are no fields on the record with these names. cmdb_ci.sys_id should work if you are supplying a sys_id (although it is redundant to type .sys_id for a reference field).
You should first verify your query through the ServiceNow UI before attempting to use it in an API call.
Type sc_req_item.list in the Filter navigator
On the filter list select "Show related fields"
Get your filter to work correctly
Right-click on the filter and select "Copy query"
The next step is to test it using the REST API Explorer.
Final step is to configure your client tool (PowerBI).

Get all groups with groupLifecyclePolicy enabled via Microsoft Graph

I'm assigning groupLifecyclePolicy to thousands of O365 groups via my webapp and I need a way to retrieve the groups that have the groupLifecyclePolicy assigned without querying every single group individually.
Unfortunately the groupLifecyclePolicy does not have a "List groups with specified groupLifecyclePolicy" method.
Is there any way to create a filter that filters on this?
I tried
'https://graph.microsoft.com/beta/groups/5e879c76-cd26-4238-a94f-ba0ade56a659?select=id,displayName,groupLifecyclePolicies'
but only got the 2 other attributes. I think this means, that the attribute is a lookup elsewhere.
Does anyone know of a way to apply a filter similar to (pseudocode):
'https://graph.microsoft.com/v1.0/groups?$filter=contains(groupLifecyclePolicies)'
or any other way that does not involve calling:
'https://graph.microsoft.com/beta/groups/<id>/groupLifecyclePolicies'
for all groups?
Unfortunaly it is not possible. The only way, indeed is to separate it in multiple requests.
Get all group id`s:
https://graph.microsoft.com/v1.0/groups?$select=id
Get policy property:
https://graph.microsoft.com/v1.0/groups/{id}/groupLifecyclePolicies
Make sure to add Retry-After header to avoid throttling(https://learn.microsoft.com/en-us/graph/throttling)

How to merge streams in flutter?

I'm trying to query 2 collections from firebase and put it in a streambuilder.
There are lot of questions like this,but a lot of them are unsolved,or I just didn't really found the right one.
So,I got a users,and a salons collection in Firebase.
user1 contains his name,age,etc and he have another collection called favsalons. In salons are the description of salons like name,owner,etc
In app I want to list out the favsalons with their datas.
In SQL it would look something like this : Select salons.name,salons.owner From salons,user Where userID=user1 and favsalonsID=salonsID
Since I'm new to flutter,and to the non SQL databases,I got no clue how to do it.
Is there a simple solution?
You can't... You need to modify the structure of your data.
Watch the firebase team explanation.
Solved with simply nesting two streambuilders.

Is it possible to get all items using get_internal?

I have a need to be able to retrieve all items for a particular resource via a custom route. when I use the function as such get_internal("users", **{"role": item["_id"]}) I am only able to retrieve 50 users. Is there a way to tell get_internal to get all matching items? even if the number of items exceeds the PAGINATION_DEFAULT setting? Also is there any documentation on the <method>_internal functions?
Please see PAGINATION_LIMIT, PAGINATION_DEFAULT and QUERY_MAX_RESULTS. (Sorry, links only highlight the words in the page)

Delete multiple documents in CouchDB

I've a "best practice" question on CouchDB (actually I'm using TouchDB a CouchDB port to iOS), when using CouchCocoa framework.
I need to delete a bunch of documents that I get via a query.
I know 3 ways to do this:
1) put all the documents into an NSArray, then use [CouchDatabase deleteDocuments:]
2) foreach query rows call the delete method, like:
for (CouchQueryRow* row in query.rows)
[row.document DELETE];
3) create a query that emit the _id, _rev properties and add the _deleted property, then use the bulk update, like:
[couchDatabase putChanges:]
What's the better performance-wise? There's a better way to do it?
At the HTTP API level, the fastest way to achieve this is to run a single batch request that provides the _id and current _rev of all documents to be removed.
Your job is to make sure that CouchCocoa actually does this — I know that CouchCocoa will try to cache the _rev of documents it reads, so if you are deleting documents that have just been read, [CouchDatabase deleteDocuments:] should be enough, otherwise you will have to [CouchDatabase getDocumentsWithIDs:] first.
If your documents are very large, it might become better to get the _rev using a view instead of a bulk fetch. This forces you to use [CouchDatabase putChanges:] to perform the bulk deletion. I don't know where the document size threshold lies, so you will have to benchmark this one.
Of course, you also need to decide what happens when a conflict occurs.

Resources