Below you can find example of the ad hoc polymorohism in Scala.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.messages.find({ | |
| "headers.Message-ID": "<8147308.1075851042335.JavaMail.evans@thyme>" | |
| }); | |
| db.messages.update({ | |
| "headers.Message-ID": "<8147308.1075851042335.JavaMail.evans@thyme>" | |
| }, { $push: { "headers.To": "[email protected]" } }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.albums.ensureIndex( {"images" : 1} ); | |
| db.albums.aggregate( | |
| { $unwind : "$images" }, | |
| {$group: { _id:null, images: {$addToSet:"$images"}}} | |
| ).forEach(function(doc){ | |
| db.images.remove({_id: {$nin: doc.images}}); | |
| // var kittens = db.images.find({tags: "kittens", _id: {$in: doc.images}}); | |
| // print(kittens.count()); | |
| }); |
Small gist with some demo trait that shows an example on how to loop through json
object and change values with circe in Scala.
Code example you can find below at circe-loop-json-object-example.scala.
The input JSON for test is kinda in in DynamoDB dump format:
- Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin [email protected]:xxx/xxx.git (fetch)
origin [email protected]:xxx/xxx.git (push)
production https://git.heroku.com/xxx.git (fetch)
production https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
OlderNewer