룬룬이
룬룬이7mo ago

convex-ents field options default and index

I have been working on setting up my schema using convex-ents and one thing I noticed is that when I am defining a field to give it options, I cannot give it a default as well as an index. Is this intended behavior? The use case is that I would like to increment the userCount each time someone joins a community. I will have to index it to order it by userCount. However, if I don't give it a default, I'll probably end up getting an error somewhere down the road because I'll forget to give it an initial value and try to increment 1 to undefined. .field("userCount", v.number(), { default: 1, index: true })
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?