java - Add projection to morphia query -


Questioning with Morphia Is it possible to limit the returned areas? (Specify the launch)?

On the command line like this:
db.Institution.find ({name: / ^ Berlin}}, {slug: 1})

or with Java driver: BasicDBObject launch = new BasicDBObject ("Slug", 1); Collection.find (new BasicDBObject (), projection);

thanks

you do, see

  Pattern regex = Pattern.compile ("^ Berlin"); Query & lt; InsitutionEntity & gt; Query = mongoDataStore.find (InsactionEntity.class) .field ("name") equals (regex). Removed field (true, "slug"). AsList ();   

(this did not test, but it should work like this)

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -