Jordan Stout

Results 91 comments of Jordan Stout

Yeah I didn't ```typescript class MyEntity { @f.primary().mongoId() _id: string; // excluded by default @f.exclude() get id(): string { return this._id.toHexString() } } const myEntity = new MyEntity(); myEntity._id =...

@marcj Groups is going to be awesome! I thought of a few more use-cases though. Let's say `database-library` uses `marshal.ts`, but I want to also bring in another library, `api-library`....

@marcj To put it simply... I have a library, `type-mongodb` which at the moment hydrates mongo documents into class form. Here, I'd like to continue using my decorators as is,...

That's confusing. I'd expect _id to be an ObjectId (which you have in mongoToPlain), but it's typed a string. How do I get both (how mongoose does it as an...

@marcj I guess I haven't dug into exactly how this library works. Going between the types, I wasn't sure if it's taking an ObjectID, converting it to a string, then...

@marcj The only use-case is that it's typed and not just a string, but due to compilers doing it's internal validation, not really a problem. You're right about ObjectID use-case....

Sorry, maybe for us, after switching to GraphQL completely, we kept clients super lean and dumb. Mixed entity classes that had dependencies on things such as `@nestjs/graphql` meant the client...

And yeah, the exclude will work for now. I'm just going to build plain object serialization into the mongo library instead of allowing me to add fields in "user-land" code....

> Yeah, I tried code generators as well, but it's not a joy. Haha. Our team tried both, and everyone felt better going the generator route. GraphQL for us has...

@marcj I get an error: `TypeError: _parents.slice is not a function`. In this case, `_parents` = `ToClassState` instance