It seems to me there is no solution for this, but I will still ask to see if anyone can help me.
I'm trying to use Newman to run my Postman collection, but I have a problem. Newman doesn't seems to be able to use Collection Variables. I've encountered this error while trying it:
getaddrinfo ENOTFOUND {{baseUrl}}
This is because I use the variable {{baseUrl}} to define my base url without needing to repeat it.
"variable": [
{
"id": "baseUrl",
"type": "string",
"value": "https://dev.sonsy.io/api/v1"
}
]
And if I hover over the variable in Postman Collection Runner it tells me that the scope of the variable is Collection. I would like to keep using collection variables instead of creating an Environment or Global Variables.
Is there any work around? Could it be that my Collection is wrongly structured for Newman? It works just fine in the Postman Collection Runner.
Thank you and good coding ;)
Update your Collection variable's Initial Value with there Current Value.
Newman only takes Initial values from Collection Variables.
Related
In my app, I'm using RTDB multiple instances, together with RTDB management APIs, to try to dynamically balance the load.
So my point is, because I don't know future load, I will just start with one RTDB instance, and create multiple ones if a specified threshold of usage is exceeded.
In my case, this requires the following:
create new RTDB instance through management API
apply rules to that RTDB instance
apply cloud functions to that RTDB instance
1 and 2 could be programmatically done inside a cloud function, but I'm having troubles with 3.
Is this possible?
Are there any workaround or future plans to support 3?
I'm thinking about two options: deploy a function from a function, or allow RTDB triggers to apply to every instances.
As you can check here in the management API documentation, the response body of the create method returns a DatabaseInstance object which has the following structure:
{
"name": string,
"project": string,
"databaseUrl": string,
"type": enum (DatabaseInstanceType),
"state": enum (State)
}
So, you can get the databaseUrl value, store it somewhere in your code and send it to your cloud function as a parameter later, assuming it is a http function. In the function all you have to do is use the following code to access it:
let app = admin.app();
let ref = app.database('YOUR_SECOND_INSTANCE_URL_HERE').ref();
EDIT
For triggered functions this is not possible, since you would need to know the instances names or URL when deploying to function to apply the trigger to them. If you already have the instances names you could try doing something like this community answer, although I am not sure it will suit your app's needs.
I'm using ngrx/redux pattern in my app.
In Normalizing State Shape article, is it written that I should create a "table" for each object and link between them by an id.
for example:
posts = [{ id, author, comments: ["commentId1", "commentId2"....] }]
comments = [{ id: 'commentId1', comment: '..' } … ]
From my server side I get the object nested within,
posts: [ { id, author, comments: [ { id, comment } ] } ..]
So I need to write a code to refactor the object that match the Normalized State? for each arrays properties in my objects?
Is sound a big work to do. First, am I right I need to do that? Second, If so, there is a easy way to handle this?
I recently faced the same problem. I ended up using NGRX Entity with different states. In your case, one state for posts and one for comments. One could go further and normalize everything much more, but as you said it is a lot of work and I am not sure if it is worth it.
I found Todd Motto's tutorials to be really good: https://www.youtube.com/watch?v=al0LNgH3I4A
One way or another, you will still need a mapper that maps your server object into models you can use in your app. Different selectors can than help you to easily get the right comments for a given post.
I'd like to build a small MeteorJS application, which contains a bar chart, which needs to be updated any time that the underlying MongoDB data changes.
Usually, most of the graphic libraries rely on JSON array as their "local" data sources. If I have to use such an array, how can I associate it with a Mongo collection, and make the array values update any time that collection changes?
While looking at https://forums.meteor.com, I have found a complete working example, which illustrates the solution to my problem. Here is the specific thread: https://forums.meteor.com/t/solved-how-to-draw-bar-chart-using-highcharts-and-mongodb-data-reactively/5156/17 , in which user jhuenges pints to the following meteorpad example: http://meteorpad.com/pad/iNfXQwMW3RwrokTe8/Chart
The key elements of this solution:
1) The 'data' element for the Chart is defined as a variable, who's values come from Mongo cursor:
series: [{
name: 'No. of Patients',
data: data
}]
Template.agecolumn.onRendered(function() {
Tracker.autorun(function () {
var data = Data.find({symptoms: {$in: ["Vomiting"]}}).fetch();
This combination insures, that, at any time, when the server-based MongoDB is updated, the values within 'data' are refreshed, and the Chart is re-rendered.
I have tested this by connecting my RoboMango utility to the server-side instance of MongoDB, and changing/removing values directly from the database.
As soon as any such change was applied to the server-side Mongo, the front-end Chart was refreshed automatically to reflect the changes, which is exactly what I was looking for.
As Christian Fritz suggested in his reply to my initial question, Tracker.autorun was used to facilitate the desired result.
I have been trying to add a new table to the database. Now, I have created
the table and I am going through conductor API to populate/update it. I have
defined some function to achieve the task. There function are defined in conductor
and db api, along with in conductor.manage and db.sqlalchemy.api. When I try
to run the system it says
AttributeError: 'ConductorAPI' object has no attribute 'xxxxxx'
while the function is properly defined in Conductor API as well as manager and
db.API. I back traced the flow of the code and it looks like the code reaches till
conductor.api. The function at the conductor API is defined as:
"""In class LocalAPI"""
def xxxxxx(self, context, node_id, values):
return self._manager.xxxxxx(context, node_id, values)
Now, after this it gives the error. Though the function is present in conductor.manager.
Please help me find out why am I getting this error.
So, I figured it out. You also need to add the interface to the conductor.rpcapi and now it's working fine!
I'm trying to secure accessing a specific collection but I'm having troubles doing it. I have no problems disabling the insert, update and delete with the Collection.allow() map.
The problem is that I also want to filter the results returned by the Collection.find() and Collection.findOne() function. I read about the Meteor.publish() and Meteor.subscribe() stuff, but somehow I cannot make it work (it's not getting filtered, I just can see all the results).
In my server-code I do the following:
Groups = new Meteor.Collection("groups");
Meteor.publish("myGroups", function() {
if (Functions.isAdmin(userId)) {
return Groups.find({
sort: {
name: 1
}
});
}
});
The function I'm using really works (so it's not that it's always returning true).
In the client-code I wrote the following:
Meteor.subscribe("myGroups");
Groups = new Meteor.Collection("groups");
Now when I do Groups.find{}); at the client I still get all results (and I should get no result).
Am I misunderstanding something or doing something wrong? I could of course make the collection completely server-side and use Meteor.methods() and Meteor.call() to get the collection data (so that it's always encapsulated by the server). But I really thought it would be cool that I didn't have to do that.
Also I wonder why this can't be done on the same level as insert/update/remove with Collection.allow(). I mean, it would be could that we could have the possibility to add a filter to the map for reading data through find/findOne.
Like #Tarang said, removing autopublish by executing the following command works:
meteor remove autopublish