Apologies if this question has been asked before, but I couldn't get an answer even after a few hours of browsing.
My requirement is simple: I want to Insert and Update an entire JSON into DynamoDB table using SDK v2.
Instead of using Map<String, AttributeValue>, I want to use a HashMap<String, Object> and update the entire JSON. I assumed this would be a standard use-case given that DynamoDB is to used with structured data.
Please help!
Related
I am trying to implement PATCH - application/merge-patch+json for my application. I need to update nested dictionaries depending on the request that comes in.
Now, at the backend, this data is stored in DynamoDB. I can't figure out how to build the dynamoDB.updateItem payload dynamically. I.e. set_expression, name_attributes and attribute_values.
I tried following the answer here https://stackoverflow.com/a/71110148 but the while loop is misplaced in the code and I can't figure out what all needs to be nested under it.
Any help is appreciated. Thanks.
I started using Firebase for Android app with Kotlin. So the question is how to use Firebase built-in features instead of adding ORM? I would like to work with classes and objects, instead of dealing with get, set, onSuccessListener and other firebase methods.. So I can create some semi-ORM by myself, by dividing everything to adapter and models. However is there simpler solution? I assume there should be some built in features in Firebase?
E. g. we can query documents with Firebase functions and map them to classes as per official manual:
val docRef = db.collection("cities").document("BJ")
docRef.get().addOnSuccessListener { documentSnapshot ->
val city = documentSnapshot.toObject<City>()
}
To make controller loose coupled from the database, we can create classes AbstractModel and CityModel and Queries and FirebaseAdapter so finally we can do something like
val city = Cities("BJ")
instead of lengthy code above.
Eventually I see that problem is we need to create our own ORM for using Firebase for every project. Or is there simpler solution? Do some existing ORMs work with Firebase? I did some research, however Stackoverflow policy prohibits to post trademarks into the question.
Does Firebase offer a way to view and update our data in a more human-readable format, rather than large trees of text?
Parse has a great browser for viewing and updating tables of data, which I found invaluable. It was easy to find specific data, and columns had helper menus for creating pointers and references to objects in other objects/tables. It was also easy to translate spreadsheet data into databases of users/places/etc. I guess I'm looking for something similar in Firebase, if it exists.
Any help would be appreciated.
Firebase is a schemaless database. Since it stores the data as JSON, it offers a visualization of the data as an editable tree in your Firebase Console. It does not offer a table view, although you could easily create that yourself.
I would like to retrieve Data from a remote api (via HTTP.get) and pass it to the client. Currently I manually poll the data and implemented some template helpers, that pass the data to the views.
In case of a jquery datatable I use the jquery-datatables package and that needs a published collection.
Has anyone a hint for me how to implement this?
Just for others who might want to know how to solve this:
You'll find an example here: https://github.com/avital/publish-time/blob/master/publish-time.js
The code is shown in this 20 min video: https://www.youtube.com/watch?v=onCkNRE2q0c
With that you'll be able to quickly implement custom publish/subscribe without using MongoDB.
#richsilv: Thanks again for pointing me to the right stuff.
I'm using CoreData in my application for DML statements and everything is fine with it.
However I don't want use NSFetchedResultsController for simple queries like getting count of rows, etc.
I've decided to use fmdb, but don't know actual table names to write sql. Entity and table names don't match.
I've even looked inside .sqllite file with TextEdit but no hope :)
FMResultSet *rs = [db getSchema] doesn't return any rows
Maybe there's a better solution to my problem?
Thanks in advance
Core Data prefixes all its SQL names with Z_. Use the SQL command line tools to check out the your persistent store file to see what names it uses.
However, this is a very complicated and fragile solution. The Core Data schema is undocumented and changes without warning because Core Data does not support direct SQL access. You are likely to make error access the store file directly and your solution may break at random when the API is next updated.
The Core Data API provides the functionality you are seeking. IJust use a fetch request that fetches on a specific value using an NSExpressionDescription to perform a function. This allows you to get information like counts, minimums, maximums etc. You can create and use such fetches independent of a NSFetchedResultsController.
The Core Data API is very feature rich. If you find yourself looking outside the API for a data solution, chances are you've missed something in the API.