Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3356

Getting no data at all

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.8.2, 3.10.2
    • Component/s: Query Operations
    • Labels:
      None
    • Environment:
      MongoDB 4.0.10, Java 1.8, Spring Boot
      'org.springframework.boot:spring-boot-starter-data-mongodb:2.1.6.RELEASE'

       I am using Java Spring Boot to search BG_event collection in MongoDB Atlas. Example below shows one specific query but other queries also behave the same way.

       

      Here is configuration:

      logging.level.org.springframework: INFO

      logging.level.org.springframework.web: DEBUG

      logging.level.org.springframework.security: DEBUG

      logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG

      1. MONGODB (MongoProperties)

      spring.data.mongodb.uri= mongodb://platformUser:xyz@platform-mongo-prod-shard-00-00-ebkt8.gcp.mongodb.net:27017,platform-mongo-prod-shard-00-01-ebkt8.gcp.mongodb.net:27017,platform-mongo-prod-shard-00-02-ebkt8.gcp.mongodb.net:27017/admin?ssl=true&connectTimeoutMS=10000&authSource=admin&authMechanism=SCRAM-SHA-1

      Here is the query:

      { "reference1" : "ONEYTPEV36802700", "reference2" : "0020", "reference3" : "TLLU5489950", "reference4" : null, "timestamp" : \{ "$gt" : "2019-07-11 12:20.00", "$lt" : "2019-07-12 23:00.00" }

      , "sourceCategory" : "EDI", "sourceId" : "ONEY", "organizationId" : "874b5fcd-4774-11e9-bdf4-42010a732002" }

      This query results with 0 documents retrieved despite the fact I can see the document in Studio 3T and exact query executed from this IDE brings correct document.

      Here is the log from the server when no records are retrieved:

      EDT2019-07-12 09:21:17.563 DEBUG 1 — [nio-5013-exec-3] o.s.data.mongodb.core.MongoTemplate : find using query: { "reference1" : "ONEYTPEV36802700", "reference2" : "0020", "reference3" : "TLLU5489950", "reference4" : null, "timestamp" :

      { "$gt" : "2019-07-11 12:20.00", "$lt" : "2019-07-12 23:00.00" }

      , "sourceCategory" : "EDI", "sourceId" : "ONEY", "organizationId" : "874b5fcd-4774-11e9-bdf4-42010a732002" } fields: Document{{}} for class: class com.blumeglobal.eventmanager.entity.Event in collection: BG_event

      Expand all | Collapse all

      2019-07-12 09:21:17.567 DEBUG 1 — [nio-5013-exec-3] m.m.a.RequestResponseBodyMethodProcessor : Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json]

      019-07-12 05:21:17.568 EDT2019-07-12 09:21:17.568 DEBUG 1 — [nio-5013-exec-3] m.m.a.RequestResponseBodyMethodProcessor : Writing [[]]

      2019-07-12 05:21:17.569 EDT2019-07-12 09:21:17.569 DEBUG 1 — [nio-5013-exec-3] o.s.web.servlet.DispatcherServlet : Completed 200 OK

            Assignee:
            Unassigned Unassigned
            Reporter:
            marek.mizeracki@blumeglobal.com Marek Mizeracki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: