Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update get one document for v0.28.0 #323

Merged
merged 79 commits into from
Aug 29, 2022

Conversation

bidoubiwa
Copy link
Contributor

Add fields parameter in the get_document route.

Breaking

  • on the method Index.get_document you are now able to add a field on the fields you want to be returned in the documents.
    #[derive(Serialize, Debug)]
    struct Movie {
       name: String,
       description: String,
       age: Option<usize>
    }
    
   movies.add_or_replace(&[Movie{name:String::from("Interstellar"), description:String::from("Interstellar chronicles the adventures."), age: Some(1)}], Some("name")).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();

    #[derive(Deserialize, Debug)]
    # #[derive(PartialEq)]
    struct ReturnedMovie {
       name: String,
       description: String
    }
    let interstellar = movies.get_document::<ReturnedMovie>("Interstellar", Some(["name", "description"].to_vec())).await.unwrap();
    assert_eq!(interstellar, ReturnedMovie {
      name: String::from("Interstellar"),
      description: String::from("Interstellar chronicles the adventures."),
    });

…meilisearch-rust into update_http_methods_for_v0.28.0
…meilisearch-rust into update_http_methods_for_v0.28.0
@bidoubiwa bidoubiwa added the breaking-change The related changes are breaking for the users label Aug 29, 2022
@bidoubiwa bidoubiwa requested review from irevoire and alallema August 29, 2022 09:48
src/indexes.rs Outdated Show resolved Hide resolved
src/indexes.rs Outdated Show resolved Hide resolved
@bidoubiwa bidoubiwa requested a review from irevoire August 29, 2022 14:29
Base automatically changed from update_documents_for_v0.28.0 to bump-meilisearch-v0.28.0 August 29, 2022 14:38
@bidoubiwa bidoubiwa merged commit 70f5424 into bump-meilisearch-v0.28.0 Aug 29, 2022
@bidoubiwa bidoubiwa deleted the update_get_document_for_v0.28.0 branch August 29, 2022 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants