It is possible to Generate array of strings in pact.io - pact

It is possible to create Array of strings in pact.io for example i want to create contract for below json format.
values:[values1,values2,values3]
but i have looked at pact.io documentation didn't find anything related

Related

Read all data from a table of 10k rows in a single request

Could there be problems in reading all the data of a 10k rows table in a single request?
It would be a read only request.
I would like to do it because I want to perform some queries on the array, and from the documentation I can’t find a way to do it directly with Pact.
No there shouldn't be. Read only queries are "free" atm.
You can do it in two ways
Do a select query which will always evaluate true
Get all the keys (i.e. unique ids in the table) via (keys your-table-name) and then have a separate method which returns data for a list of ids.
But do consider using select statements to help filter out your data during the query as this could be easier than you doing it yourself.
Pact will check arrays like any other property, but you should ask yourself the question - do you need to test all 10k records or just a representative sample of them (the answer should in most cases be the latter).
You should also consider:
Do you need to exact match? (if so, the consumer and provider must have exactly the same data - not recommended)
Can you use matchers to check the shape of the items in the array

Power Automate Flow: Convert json to readable PowerAutomate-Items

In CRM I have a 'Doc_Config' value.
The 'Doc_Config' value gets passed to Power Automate Flow
With the data I populate an Microsoft Word Document. My problem here is, that instead of the data the raw text is filled into the Word Document.
Is there a way to convert the raw text so Power Automate recognizes the data I actually want? Like as if it is presented to the Flow like so:
Problem: You probably have copied the path for your objects and pasted the path value in your 'Doc_Config' value. Here the problems should be with the #{...} pattern.
Solution: Please, remove #{...} pattern from any objects that you are referring to by their path as in the example below:
incorrect:
#{items('Apply_to_each_2')?['productname']}
correct:
items('Apply_to_each_2')?['productname']
Background:
In Power Automate cloud flows, you reference objects that the dynamic content tooling offers. However, sometimes you want to catch objects that the dynamic content tooling cannot see, or does not provide. At these times, you can refer to them by specifying the path for them as in the example below.
items('Apply_to_each_2')?['productname']
You can observe the path for the objects by hovering over any object that the dynamic content tooling is providing you.
Another option would be to simply parse the data from your array, as it is already JSON.
I will add three links here to Imgur images as I can't post images directly yet, but the idea is very simple:
Append your data to your array variable
Add a Parse JSON task, click generate from sample, and paste in the JSON you use.
Your actions can be used in all other steps now.
The images will clarify a lot.
Append your data
Parse your data
Use your data

What's the best way to store an array in a relational database?

I'm currently trying to design a database and I'm not too sure about the best way to approach a dynamically sized array field of one of my objects. My first thought is to use a column in my object to store an array of integers. However the more I read, the more I think this isn't the best option. Concrete example wise, I have a player object that stores 0 to many items, which are represented by an integer. What is the best way to represent this?
If that collection of values is atomic, store them together. Meaning, if you always care about the entire group, if you never search for nested values and never sort by nested values, then they should be stored together as a single field value.
If not, they should be stored in a separate table, each value bring a row , each assigned the parent ID (foreign key) of a record on the other table that "owns" them as a group.
For example, a clump of readings from a scientific instrument that are only ever used together as a collection for analysis should be stored together in a field. In contrast, a list of phone numbers for a customer that may often need to be queried for an individual number should probably be broken up into single phone number per row in a related child table.
For more info, search on the term "database normalization".
Some databases, support an array as a data type. For example, Postgres allows you to define a column as a one-dimension array, or even a two dimension array.
If your database does not support array as a type of column definition, then you may have three alternatives:
XML/JSONTransform you data collection into an XML or JSON document if your database your database supports that type. For example, Postgres has basic support for storing, retrieving, and non-indexed searching of XML using XPath. And Postgres offers excellent industry-leading support for JSON as a data type including indexed support on nested values with its jsonb data type where incoming JSON is parsed and stored in an internally-defined binary format. This feature addresses one of the main reasons people consider using the so-called “NoSQL” systems, looking to store and search semi-structured data.
TextCreate a string representation of your data to store as text.
BLOBCreate a binary value to store as a binary large object (BLOB).

TALEND DI Job to create points-polygons and store them to postGis table

which is the best way to create points and polygons starting from raw data and than store them into a postGIS table containing a geometry column?
Thanks
Let me try to elabore a more precise answer.
The first step is reading the raw data. There are many components to read data from : JSON, XML, Delimited text file, Excel, etc
I would read that data into a tMap component in order to get full control of the data being read.
Then, I would create a user routine that receives in input the raw data, and return the data in the format you want.
Then, I would use something like the sPostGisInput to insert this data into the PostGisDB
I don't know how postgis work, so perhaps you will need to adapt this solution a little bit in order to get it working.
Helpful link : Strategy to load a set of files in Talend
Helpful blog : http://bekwam.blogspot.com/
Helpful wiki : https://github.com/talend-spatial/talend-spatial/wiki

couchdb complex map reduce over multiple documents give back single json object

How to create a complex map reduce function in couchdb to span a view over multiple documents with same attribute names to give back a single json object?
What is the most efficient way to manage this?
Is a nested set/source algorithm suitable for couchdb (changes are very write intensive)?
If you want the whole documents you shouldn't use reduce. Just do a proper map function for the "type" attribute you talked about earlier and query the view with include_docs=true.

Resources