+1
Beantwoord
What type of databases can be used on a local level?
Hello,
I was wondering what type of databases can be used on a local level. I know that XML can be used if you have it in your root folder and if you do res://(Name of database), but can I have a local JSON database? If not is there anyway to write/delete data from the xml database?
Thank you for your time,
-Ryan
I was wondering what type of databases can be used on a local level. I know that XML can be used if you have it in your root folder and if you do res://(Name of database), but can I have a local JSON database? If not is there anyway to write/delete data from the xml database?
Thank you for your time,
-Ryan
Customer support service by UserEcho
If you are set on json, one solution you can consider using is to create a second datasource (one json must still be external) and then use the 'add' object property to populate this new json from your external source, which will then be stored locally. This would then leave you the ability to update this local json with new data at any time, but should reduce load time on rotate. This json would be local, but would not display inside your project as a visible file similar to creating a SQL on the fly.
See info on add in the object properties section here: https://studio.rarewire.com/wordpress...
Example:
<httpheader name="redBox-header" Accept="application/json" /> <datasource name="redBox-default" source="" httpheader="redBox-header" query="/Products/Movie" providertype="json" urlcacheduration="43200" datasourceerror="redbox-error" /> <datasource name="redBox-movies" source="" query="/Products/Movie" providertype="json" /> ..... <assign property="datasource:redBox-default.source" value="https://api.redbox.com/v3/products/movies/default?apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&pageSize=100&pageNum=1&includeComingSoon=false" /> <assign property="datasource:redBox-movies.add" value="{ "originDataSourceIndex" : "[var:inventoryIndex]", "Title" : "[datasource:redBox-default.[var:inventoryIndex].Title]", "productId" : "[datasource:redBox-default.[var:inventoryIndex].@productId]", "BoxArtImage" : "[eval: JSON.parse('[datasource:redBox-default.[var:inventoryIndex].BoxArtImages/link]')[1]['@href']]", "ReleaseYear" : "[datasource:redBox-default.[var:inventoryIndex].ReleaseYear]", "MPAARating" : "[datasource:redBox-default.[var:inventoryIndex].MPAARating]", "RunningLength" : "[datasource:redBox-default.[var:inventoryIndex].RunningLength]" }"/>
Another solution is that you could store JSON data inside of a texttemplate directly in the WIRE code and run it out that way, though this is a more static approach.