Giter VIP home page Giter VIP logo

Comments (6)

Elfocrash avatar Elfocrash commented on June 15, 2024 4

Enhancement added!
61bbd0d

Shared collections will no longer default to id as a partition key.

Thanks for the suggestion.

from cosmonaut.

Elfocrash avatar Elfocrash commented on June 15, 2024

Hello Ryan,

You are totally right, I actually wanted to remove this limitation.

Still haven’t figured out what would be the best way to tackle it from a coding standpoint (how the consumer will set this partition key even if the two objects don’t have the same interface), but I will come up with something.

Thanks for the feedback.

from cosmonaut.

ryancrawcour avatar ryancrawcour commented on June 15, 2024

I can take a look and submit a PR and we can go from there, if you like

from cosmonaut.

Elfocrash avatar Elfocrash commented on June 15, 2024

Currently the way to specify the partition key on the dto level is to use the [CosmosPartitionKey] attribute. This makes Cosmonaut to do all the partition key stuff automatically. It would be nice if the solution is something along those lines.

Of course if you can think of something better I’d be more than happy to hear it (or even see it with a PR)

from cosmonaut.

Elfocrash avatar Elfocrash commented on June 15, 2024

Ok after I had a coffee I think I have a plan of attack.

  1. Remove the SharedCollection default to /id partition key logic.
  2. Honor the [CosmosPartitionKey] attribute in entities that are part of shared collections.
  3. Let the user deal with the errors when they have PartitionKey inconsistencies between two different entities that are sharing a collection but also make the right way to do it really clear in the documentation.

I still have one unanswered question though.
In the CollectionCreator's logic, if they don't specify the [CosmosPartitionKey] do I default it to /id or do I just create it without a partition key at all, limiting them in 10 GB?

I'm leaning towards the second one because it gives more control to the user. What do you think?

from cosmonaut.

ryancrawcour avatar ryancrawcour commented on June 15, 2024

Very cool!

from cosmonaut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.