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

Regex operation within $search operation doesn't exist

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Builders
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      I have a search operation that works fine in mongo aggregations, but when I try and write it in java (Spring framework) and it appears the operation hasn't been added.

       

      Where I expected it to be:
      com.mongodb.client.model.search.SearchOperator
       
      $Search aggregation step (MongoDb):

      {
        index: "default",
        regex: {
          query: ".*tes.*",
          path: {
            wildcard: "*",
          },
          allowAnalyzedField: true,
        },
      } 

      Java code:

      Bson bsonSearch = Aggregates.search(
             SearchOperator., //No regex operation
             SearchOptions.searchOptions()
                   .index("default")
      );

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            jack.bracey@prototaluk.com Jack Bracey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: