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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve serialization errors in .NET examples #37

Merged
merged 1 commit into from
Sep 26, 2023

Commits on Sep 23, 2023

  1. fix: resolve serialization errors in .NET examples

    This ended up being a *slightly* bigger commit than I anticipated. But,
    I essentially did two things:
    
    - Annotate all `*Result` types in `Mondocks.Net/Types.fs` with
      `[<BsonIgnoreExtraElements>]`; otherwise, the .NET MongoDB Driver
      freaks out that the schema doesn't match exactly.
    
    - Avoid serializing each `Index` object in the `IndexBuilder`.
      When I first ran the example in `samples/Indexes`, it failed with this
      exception:
    
      ```sh
      Unhandled exception. MongoDB.Driver.MongoCommandException: Command createIndexes failed: BSON field 'createIndexes.indexes.0' is the wrong type 'string', expected type 'object'.
      ```
      So we DON'T need the serialization step in the `IndexBuilder` anymore
      (though I kept the interface the same).
    
    Finally, I added a Nix flake with a very simple `devShell` because
    that's just what I'm used to developing with.
    moonshxne committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    ab0e01b View commit details
    Browse the repository at this point in the history