Btw. the named parameter syntax looks rather ugly for MongoDB which uses the ":" character itself extensively (that's why I started with "?" initially):
String nativeQuery = "{ $and: [ { name : :nameParameter }, { author : 'Oscar Wilde' } ] }";
To make things worse, something like
is valid in MongoDB given there is a variable named "bar" referenceable from the given context which makes this indiffentiable from a named parameter. Based on that I'd even say we should only support positional parameters for MongoDB where we don't have that problem. Or, we provide a way for specifying a grid dialect's supported parameter syntax.
|