Hello!
I am running mongoDB Atlas and I am trying to do an aggregate request to my cluster. If go to mongoDB Atlas and try to perform the query on the webpage, it works just fine.
Here's the query:
{
$search: {
index: "default",
search: {
query: "Test",
path: "name"
}
}
}
However, when running my app the search returns nothing. Here's the code I use in Rust:
if let Ok(mut r) = collection.aggregate(search).await {
let mut results = Vec::<(String, String)>::new();
while let Some(d) = r.next().await {
println!("Search success!");
if let Ok(d) = d {
let id = d.get_object_id("_id").unwrap();
What's more interesting is that if I put a breakpoint on the top row and then run it step by step, I actually do get a result and it prints "Search success!". Anyone have any ideas what's causing this?
Thanks,
Gustav