markschaake / sprest Goto Github PK
View Code? Open in Web Editor NEWSprest is a collection of libaries to make building REST services simpler using Spray.
Sprest is a collection of libaries to make building REST services simpler using Spray.
I have ISODate type dates in mongo database and I tried using DateTime for case class type variables but then I try to load the data in browser it is empty not even an empty array. I tried using Long, Int or String types to no result.
See: https://github.com/t3hnar/scala-bcrypt for scala impl
See: http://www.mindrot.org/projects/jBCrypt/ for java library that above uses
What's really cool about BCrypt is that it embeds the salt into the hash and is able to extract the salt from a given hash. Allows you to forget about the salt (i.e. no need to store it separately or have a strategy for combining / extracting salt+hash)
The dependency is broken. I tried to compile it in sbt, not successful. The warning is here:
[warn] ==== sprest snapshots: tried
[warn] http://markschaake.github.io/snapshots/org/reactivemongo/reactivemongo_2.10/0.10.5.akka23-SNAPSHOT/reactivemongo_2.10-0.10.5.akka23-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.reactivemongo#reactivemongo_2.10;0.10.5.akka23-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.reactivemongo#reactivemongo_2.10;0.10.5.akka23-SNAPSHOT: not found
The ReactiveMongo DAO is optimistic in saves (both create and update). Should be checked. See: https://github.com/markschaake/sprest/blob/master/sprest-reactivemongo/src/main/scala/sprest/reactivemongo/Persistence.scala#L122
Seems like magnet pattern could be used instead of all the id-type specific overloads of "rest" directive.
Hi,
example throws incompatible type on sbt run
:
Error:(12, 7) overriding method id in trait Model of type => String;
variable id has incompatible type
var id: Option[String] = None) extends Model[String]
^
I'm trying to update a model as follows:
val event = Event(id = Option(id), title = title, description = description, customer_id = customer_id, updated_at = new Date().getTime)
val future = Events.update(event)
What would be a good approach to update only selected fields?
Thanks
By default Mongo handles ids in ObjectID format which takes less space and is faster to process but in the current sprest id type is string and if in database ids are in ObjectID type sprest returns empty variables.
Hi Mark, the repository mentioned on Homepage
"http://markschaake.github.com/releases" is redirecting.
It would be nice if a model has a Json format that we can specify that to be used for to/from BSONDocument.
Hi, this is not an issue but need an advice on how to create a nested model in sprest with the following json:
{
"contacts":[
{
"id": 1,
"name": "Alice",
"items": [
{
"id": "a",
"type": "phone number",
"value": "555-1234-1234"
},
{
"id": "b",
"type": "email",
"value": "[email protected]"
}
]
}
]
}
I am new to sprest, spray and scala. Currently I am following examples from ExNexu...
I've just seen that there are no packages for Scala 2.11 yet so I started to play around with the build files and it seemed to be an easy integration except for the Slick dependency ( slick/slick#839 ). After upgrading Slick to 2.1, it should be easy to support Scala 2.11 in Sprest.
I need mongo document update functionality and it is added only in 0.3.2 but since examples are not backwards compatible it takes more time to figure thing out.
https://gist.github.com/gloopeezza/8515660
Then you can simply declare BSONDocumentFormat[T]
from auto generated jsonFormatX
:
implicit val userFormat: BSONDocumentFormat[User] = jsonFormat4(User)
I might be wrong, but I see a custom enumeration implementation, Enum.
Adding some Enum based property on a class (like ToDo) inside an example could be a nice idea.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.