I'm trying to iterate and get the value from a nested BSON OrderedDocument
. I tried this:
for post in cursor {
if let Ok(item) = post {
println!("{:?}", item.get("sentiment")); // get "kelas" inside "sentiment"
}
}
for post in cursor {
if let Ok(item) = post {
for row in item.iter() {
println!("{:?}", row); // get ["sentiment"]["kelas"]
}
}
}
Comments
Post a Comment