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
val encoder = new com.mongodb.DefaultDBEncoder() | |
def encode(doc: DBObject): Long = { | |
encoder.synchronized { | |
val start = System.currentTimeMillis() | |
val encoded = encoder.encode(doc) | |
val end = System.currentTimeMillis() | |
end - start | |
} | |
} | |
DeregisterConversionHelpers() |
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
[error] /Users/brendan/code/mongodb/casbah/casbah-query/src/main/scala/Implicits.scala:151: not found: type scala | |
[error] @annotation.implicitNotFound("${A} is not a valid query parameter") | |
[error] ^ | |
[error] /Users/brendan/code/mongodb/casbah/casbah-query/src/main/scala/Implicits.scala:151: not found: type scala | |
[error] @annotation.implicitNotFound("${A} is not a valid query parameter") | |
[error] ^ | |
[error] one error found | |
[error] one error found | |
[error] {file:/Users/brendan/code/mongodb/casbah/}casbah-query/compile:doc: Scaladoc generation failed | |
[error] {file:/Users/brendan/code/mongodb/casbah/}casbah-query/compile:compile: Compilation failed |
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
[bamboo@bamboo-agent1 python2]$ ls | |
nosify.sh pip_me.sh r2.4.6 r2.5.6 r2.6.7 r2.7.2 |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import com.novus.salat._ | |
import com.novus.salat.global._ | |
import com.novus.salat.dao._ | |
import util._ |
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
trait JodaDateTimePrimitive extends BSONDatePrimitive[DateTime] { | |
def rawValue(bson: Long): DateTime = { | |
new DateTime(bson) | |
} | |
def bsonValue(raw: DateTime): Long = { | |
raw.getMillis | |
} | |
} |
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
implicit def kvPairAsDBObject[A <: Any](kv: (String, A)): DBObject = MongoDBObject(kv) | |
sealed class NestedListOper(outerField: String) { | |
def apply[A <% DBObject](fields: A*): DBObject = { | |
val b = Seq.newBuilder[DBObject] | |
fields.foreach(x => b += x) | |
MongoDBObject(outerField -> b.result()) | |
} | |
} |
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
/* I'm trying to refactor $and and $or (which are essentially the same code returning a different outer query). | |
The problem is that currently only "String, Any" pairs work, and I need to be able to combine both those *AND* "Query Expression Objects". | |
Here's the $or spec right now | |
*/ | |
"Casbah's DSL $or Operator" should { | |
"Accept multiple values" in { | |
val or = $or("foo" -> "bar", "x" -> "y") |
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
/** | |
* Trait to provide the $or method as a bareword operator. | |
* | |
* $or ("Foo" -> "bar") | |
* | |
* Targets an RValue of (String, Any)* to be converted to a DBObject | |
* | |
* TODO - Test that rvalue ends up being an array e.g.: | |
* | |
* scala> $or ("foo" -> "bar", "X" -> 5) |
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
# note that I see *EXACT* same results as the original post with the original code. | |
# The fix below makes that not happen anymore (use snapshot mode) | |
# mongo.jar on my machine is the shipped version of 2.7.0, so same exact Java Driver of original test | |
# ( I was lead on the 2.7.0 release and did the build/release ) | |
b-mac mongodb/mongo-java-driver ‹master*› » scala -cp mongo.jar Repro.scala | |
Inserting canary... | |
Inserting test data... | |
Paging through records... | |
Spotted the canary! | |
Updating canary object... |
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
import scala.util.parsing.combinator._ | |
trait RunParser { | |
this: RegexParsers => | |
type RootType | |
def root: Parser[RootType] | |
def run(in: String): ParseResult[RootType] = parseAll(root, in) | |
} | |
case class Variable(name: String) |