Closed rucas closed 6 years ago
Hi @rucas, I suspect the easiest solution to the issue you're facing is simply to replace all instances of @ObjectID
with @Property(String)
on those models which use non-ObjectID based _id
s. If you want something a bit more specific, you should be able to use @Property(/^[A-Za-z0-9]{10}$/)
to give you validation that it is indeed a subset of all the possible randomly generated, 10-character, IDs that your function produces.
class MyModel extends Instance<MyDoc, MyModel> {
@Property(String)
_id: string;
}
This is a very specific case, I'm currently trying to migrate an old parse-server web app that created a bunch of _id's using a random alphanumeric generator of length 10.
I have some models that use the
@ObjectID
property that fail at validation during a lookup by_id
, but work on creation. Is there anyway to turn off or override the validation?