Why has the Typescript Fauna-js Document class no field `ttl` and `data`?

I would expect that it includes all fields of Document: https://docs.fauna.com/fauna/current/reference/reference/schema_entities/document/document_fields

Current implementation: fauna-js/src/values/doc.ts at main · fauna/fauna-js · GitHub

export declare class Document extends DocumentReference {
    readonly ts: TimeStub;
    constructor(obj: {
        coll: Module | string;
        id: string;
        ts: TimeStub;
        [key: string]: any;
    });
    toObject(): {
        coll: Module;
        id: string;
        ts: TimeStub;
    };
}

export declare class DocumentReference {
    readonly coll: Module;
    readonly id: string;
    constructor({ coll, id }: {
        coll: Module | string;
        id: string;
    });
}

Nice catch @Mike! I’ve created a GitHub issue and brought this to the engineering team. This should be fixed up soon.

Hi @Mike we’ve released this change in the update to our beta release. You can try it with installing fauna@beta.

1 Like

This topic was automatically closed 90 minutes after the last reply. New replies are no longer allowed.