Nice-Guy
Nice-Guy

Reputation: 1524

Failing to Write Any Query using MongoDB Atlas Search Index

I get this error when I try to run any aggregation using $search in a MongoDB Atlas Search index.

Remote error from mongot :: caused by :: Error connecting to localhost:28000 (127.0.0.1:28000) :: caused by :: Connection refused

Upvotes: 2

Views: 1440

Answers (1)

Nice-Guy
Nice-Guy

Reputation: 1524

I found that if I created my search index and gave it a name that is not default I need to ensure that I include the index name in the query.

  {
      "$search": {
         "index": "parks_and_recreation", 
         "equals": {
            "path": "open",
            "value": true
         }
      }
    }

Upvotes: 3

Related Questions