java.lang.IllegalArgumentException: Unsupported native query: Invalid input '....', expected WhiteSpace or EOI (line 1, pos 189): db.UserFactualContent.find( {'$or': [ {'NAME':{'$regex':'(?i)Bangalore'}}, {'DESCRIPTION':{'$regex':'(?i)Bangalore'}}],'$and':[{'FLAG':'public' }]},{ 'DESCRIPTION': 1,'NAME': 1,'TOKEN':1}).sort({'clicks':-1}).limit(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

hibernate.org | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Hibernate Community • View topic - Exception in sort query

    hibernate.org | 6 months ago
    java.lang.IllegalArgumentException: Unsupported native query: Invalid input '....', expected WhiteSpace or EOI (line 1, pos 189): db.UserFactualContent.find( {'$or': [ {'NAME':{'$regex':'(?i)Bangalore'}}, {'DESCRIPTION':{'$regex':'(?i)Bangalore'}}],'$and':[{'FLAG':'public' }]},{ 'DESCRIPTION': 1,'NAME': 1,'TOKEN':1}).sort({'clicks':-1}).limit(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. 0

    exception in nativeQuery of mongodb using with hibernateogm

    Stack Overflow | 10 months ago | javed mohammed
    java.lang.IllegalArgumentException: Unsupported native query: Invalid input '....', expected WhiteSpace or EOI (line 1, pos 189): db.UserFactualContent.find( {'$or': [ {'NAME':{'$regex':'(?i)Bangalore'}}, {'DESCRIPTION':{'$regex':'(?i)Bangalore'}}],'$and':[{'FLAG':'public' }]},{ 'DESCRIPTION': 1,'NAME': 1,'TOKEN':1}).sort({'clicks':-1}).limit(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Unsupported native query: Invalid input '....', expected WhiteSpace or EOI (line 1, pos 189): db.UserFactualContent.find( {'$or': [ {'NAME':{'$regex':'(?i)Bangalore'}}, {'DESCRIPTION':{'$regex':'(?i)Bangalore'}}],'$and':[{'FLAG':'public' }]},{ 'DESCRIPTION': 1,'NAME': 1,'TOKEN':1}).sort({'clicks':-1}).limit(1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      at org.hibernate.ogm.datastore.mongodb.MongoDBDialect.parseNativeQuery()
    2. org.hibernate.ogm
      MongoDBDialect.parseNativeQuery
      1. org.hibernate.ogm.datastore.mongodb.MongoDBDialect.parseNativeQuery(MongoDBDialect.java:863)
      2. org.hibernate.ogm.datastore.mongodb.MongoDBDialect.parseNativeQuery(MongoDBDialect.java:143)
      2 frames
    3. Hibernate Object Grid Mapper
      NativeNoSqlQueryInterpreter.createQueryPlan
      1. org.hibernate.ogm.dialect.impl.ForwardingGridDialect.parseNativeQuery(ForwardingGridDialect.java:200)
      2. org.hibernate.ogm.query.impl.NativeNoSqlQueryInterpreter.getCustomQuery(NativeNoSqlQueryInterpreter.java:50)
      3. org.hibernate.ogm.query.impl.NativeNoSqlQueryInterpreter.createQueryPlan(NativeNoSqlQueryInterpreter.java:45)
      3 frames
    4. Hibernate
      QueryPlanCache.getNativeSQLQueryPlan
      1. org.hibernate.engine.query.spi.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:210)
      1 frame
    5. Hibernate Object Grid Mapper
      NoSQLQueryImpl.list
      1. org.hibernate.ogm.hibernatecore.impl.OgmSessionImpl.list(OgmSessionImpl.java:301)
      2. org.hibernate.ogm.query.impl.NoSQLQueryImpl.list(NoSQLQueryImpl.java:130)
      2 frames
    6. org.hibernate.jpa
      QueryImpl.getResultList
      1. org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:593)
      2. org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:470)
      2 frames