MongoDB Atlas scheduled trigger service returning undefined - mongodb

I’m trying to create a scheduled trigger to clear a collection weekly, but I am unable to get the service…
const collection = context.services.get('mongodb-atlas'); is returning undefined when I log it to console, and when I try and using it, it just says Cannot access member ‘db’ of undefined. I’ve also tried setting the service name to Cluster0 and mongodb-datalake, neither of which worked.
If someone could lend a hand on what I’m doing wrong and how I’m meant to do this, that would be awesome. Thanks.

You need the following syntax to get to your collection:
const collection = context.services.get(<SERVICE_NAME>).db("db_name").collection("coll_name");
SERVICE_NAME you can find from here:
Go into Realm tab
In the left navigation, click on Linked Data Sources
Copy the Realm Service Name

Related

Supabase. How to insert user information when registering in another table?

When registering a new client on my site (Supabase + Vue.js), how do I create an entry in the %BASE_NAME% database with the following fields: uuid of the client who registered, and a JSON field with an empty object.
Somewhere in the documentation I saw, it seems, similar examples, but I can’t find them now.
Thank you!
This looks like a job for a trigger and a function.
You can't query the auth table directly, so you need to do create a function that does this work for you, triggered when a new entry is made to auth.users.
Some details here:
https://nikofischer.com/supabase-how-to-query-users-table
And a video describing the process here:
https://egghead.io/lessons/supabase-use-supabase-to-subscribe-to-database-events-with-postgres-triggers

Cannot use folder-name field to filter resources in HP QC REST API

I don't expect to get an answer on this but if anyone can help it would be greatly appreciated.
We're using HP Application Lifecycle Management 12.2 (ALM or QC/QualityCenter as it's called). I'm trying to retrieve test resources from the project using the REST api but I suspect I've come across a defect in the API.
I'm trying to filter the response by using a query, and any other query works fine but when I try to use the 'folder-name' field it fails with the following message:
Failed to set params in the parametrized query
It doesn't matter what format I try to escape the query with, I've tried the following:
/resources/?query={folder-name[%27folder%27]}
/resources/?query={folder-name['folder']}
/resources/?query=%7bfolder-name%5b%27folder%27%5d%7d
I've also reproduced this on an 11.52 QC instance so it's not just our environment. I've double checked the customization collection using the ?can-filter=true param and folder-name is supposed to be filterable.
I'm currently using the parent-id for filtering instead which works but it requires me to do another request to get the parent-id first which I would like to refrain from.
Any suggestions, patches?
Thanks
As I wrote in the comments, the error is reproducable here, and I agree that it is strange. The folder-name exists as a field in resource, and should be filterable. It seems to be a bug.
But there is another approach that I offer as a substitute solution. The resource entity offer a relation directly to the folder entity, and you can get the exact result you were looking for, by using a cross join with that table:
/resources/?query={resource-folder.name['folder']}
This is probably too late to help you with your work, but it might help others.

OrientDB: Creating Graph-database through HTTP-API

It seems it is only possible to create document-type databases via the HTTP-api. The documentation omit's information about whether the database will be created as a graph or a documentdatabase, but when creating a vertext, i get the error:
Super-class V not exists
...which, as i understand, means that the database is a document-type.
Is there any way around this? The /command/ action makes it pretty easy for me to do what I want from C#, if I could only generate a graph-database via HTTP-api...
Is there any way to create a graph-database through the HTTP-API?
Alternatively: Is there another way to create a graph-database from c#? I've tried creating a database via the console, but here i get IllegalArgumentException:
Error: java.lang.IllegalArgumentException: Storage type 'plocal' is different by storage type in URL
..which i cannot find any explenation for
Any help is much appreciated :)
I managed to have that using POST http://localhost:2480/database/<db name>/plocal/graph
I did found it experimentally. Did not found that in documentation which is a bit strange.
Tested on version 2.1.7
I got the same error message when I typed in the following command:
create database REMOTE:localhost/petshop root aaaa plocal document
Solution:
I had to write it in lower case:
create database remote:localhost/petshop root aaaa plocal document

Querying Raven Db

I have an instance of Raven Db at localhost:8081. I made sure to change raven's config file to allow anonymous access. I created a database named AT. Inside AT I have a collection named Admins. Inside of Admins I have two documents. I'm trying to retrieve some data via Rest using RestClient. I try to hit the db using:
http://localhost:8081/docs/admins/7cb95e9a (last bit is the id of the document I want).
and
http://localhost:8081/docs/at/admins/7cb95e9a.
With both I receive a 404. I'm not sure what I'm missing here. Can someone point me in the right direction?
The URL has the following format:
http://localhost:8081/databases/{{database-name}}/docs/{{document-id}}.
Collection is a virtual thing. get a document only by its ID, there no nothing on collection here. The document ID can be anything you set, but if you let RavenDB to generate it, it will probably be admins/1.

SSRS: Dropdown is not populated in filter in Report Builder

Whenever I try to apply filter to an attribute, which has ValueSelection= Dropdown, the dropdown is not populated and error message "The requested list could not be retrieved because the query is not valid or a connection could not be made to the data source" is shown instead.
If I set up ValueSelection=List I am getting a different error message:
An attempt has been made to use a semantic query extension associated with the data extension 'SQL' that is not registered for this report server.
(Microsoft.ReportingServices.SemanticQueryEngine)
This happens within BIDS environment and was observed both in SQL 2005 and SQL 2008.
I've already studied articles, which discussed the similiar problem, but neither of them applied to my case. The user account in data source has all necessary rights, data could be retrieved without any problem (for example if i try "Explore data" in data source view). The SQL profiler shows that no query is being sent to SQL Server when there is an attempt to populate dropdown. So nothing is wrong with the query, it is simply never executed.
Your connection is not working. Try to test you connection by trying a simple table and query output.
This will enable you to test the connection before trying anything advanced.
Got this problem and in my case it was caused by wrong connection string in Data Source - instead of just having a SQL Server name like "SOMESQLSERVER_MACHINE" I had for some reason "SOMESQLSERVER_MACHINE.our.corp.domain". It had to be the same, but then I realized that the domain is wrong, after removing it all works like a charm again. That said: it's always good idea to start with detailed checks on your basic settings.
Otherwise this could be a problem with permissions to the folders on Report Manager.