osinka / subset Goto Github PK
View Code? Open in Web Editor NEWEnd of life
End of life
All we depend on are AsInt
, AsLong
and AsDouble
extractors only.
Chaning Mutations by the ~ operator seems to be order-dependent in the following case:
Let m be a mutation with non-_id fields and T a compound type type representing a subset and t a value of type T. Then an insert of
m ~ "_id".fieldOfT
works while
"_id".fieldOfT ~ m
does not. Inserting the Latter omits the "_id" field thus yielding in a mongo-generated _id.
Thank you for providing Subset. It's awesome to work with it!
Please, upload a compiled version for Scala 2.9.2 to the Maven repository.
builder
: Lens, ValueReader, ValueWriter, Packing traitsquery
: Queryupdate
: Updatetuple
: Tuple* classesval regEx = "...".r
val title = "Title".fieldOf[String]
myColl.find(title === regEx)
finds no document for any regEx. But I also don't succeed with
val title = "Title".fieldOf[String]
myColl.find(title === "...normal String...")
Peter
Subset is a subtype and fields may have same simple names.
It seems that tuple2Getter
does not work correctly:
val coll = db.getCollection("Tuple2Test")
val anyDoc = new BasicDBObject
coll.remove(anyDoc)
val tuple = (1,"a")
val tupleField = "tuple".fieldOf[(Int,String)]
coll.insert(tupleField(tuple))
val tupleBack = coll.findOne(anyDoc)
println(tupleBack) // ok
tupleBack match {
case tupleField(x) => println(x) // failure
}
with the failure: scala.MatchError: [ 1 , "a"](of class com.mongodb.BasicDBList).
To fix it you'll possibly need to add/replace pattern matching against BasicBSONList
but I'm not sure how.
Thanks
Peter
I thought that fieldOf[List[T]]
and fieldOf[Array[T]]
are interchangeable and depends on what type I want to use in my code.
However, while listGetter
accepts both Array[_]
and BasicBSONList
, arrayGetter
only accepts Array[_]
and Java driver returns BasicDBList
(implementing BasicBSONList
) for nested collections.
The sources jar doesn't reflect the package structure 'com.osinca.subset' so it cannot be used in any IDE directly.
Thank you for providing Subset. It's awesome to work with it!
With respect to the Java driver's DBCollection.aggregate(), it would be nice to have built-in support for $match, $projection, $group... just like Subset provides it for $gt, $size etc.
It'd be fine if you added a link to your home pointing to the root of subset in the Central Repository. It takes quite a long time to get there by searching on Central. Thanks
E.g. {"comments.1.votes": ...}
Could you please provide example of mapping DBObject to case class ? I went through Extractors
in your documentation but it shows mapping to individual fields only. Thanks!
Examples in gist and scaladoc must reference them
In Subset 1.0.2, please update the mongo-java-driver dependency to its 2.10.1 release (or higher). Thanks
Peter
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.