-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate OGM complex queries
PostPosted: Wed Feb 01, 2017 1:01 pm 
Newbie

Joined: Wed Feb 01, 2017 12:53 pm
Posts: 1
Hello guys,

I've been trying to execute some native map reduce against Monto using Hibernate, but I'm experiencing some difficulties :) what I tried so far :

I tried this query :

Code:
"{ query: { db.article.mapReduce(function() {var key = this.instrument_code;emit(key, this);},function(key, values) {values.sort(function(valueA, valueB){if(valueA.display_datetime < valueB.display_datetime){return 1;}else if(valueA.display_datetime == valueB.display_datetime){return 0;}else{return -1;}}); return values[0] }, { query: { 'instrument_code': { $in: ['EUR', 'JPY', 'GBP', 'DJI', 'CL1', 'GOLDS'] }, 'analysis_type': 'TA' }, out: 'articles'}).find() } }"

and this one

Code:
"db.article.mapReduce(function() {var key = this.instrument_code;emit(key, this);},function(key, values) {values.sort(function(valueA, valueB){if(valueA.display_datetime < valueB.display_datetime){return 1;}else if(valueA.display_datetime == valueB.display_datetime){return 0;}else{return -1;}}); return values[0] }, { query: { 'instrument_code': { $in: ['EUR', 'JPY', 'GBP', 'DJI', 'CL1', 'GOLDS'] }, 'analysis_type': 'TA' }, out: 'articles'}).find()"

both, as native query

Code:
em.createNativeQuery(queryString, Article.class)


but looks like I'm doing something wrong here, does anyone have a hint?

Thank you!!


Top
 Profile  
 
 Post subject: Re: Hibernate OGM complex queries
PostPosted: Fri Feb 03, 2017 4:22 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
Hibernate OGM does not currently support map-reduce queries at the moment.
You can find a list of the supported queries in the documentation: https://docs.jboss.org/hibernate/ogm/5. ... cli-syntax

Aggregate will be supported in the next release.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.