Skip to content
Discussion options

You must be logged in to vote

You need to do it like this:

// initialize *once* for the lifetime of the process
const store = new DocumentStore(urls, database, {
            type: 'pfx',
            certificate: buffer
        });
// We are reading 'PascalCased' data but we want to convert them to 'camelCased' objects.
store.conventions.remoteEntityFieldNameConvention = 'pascal';
store.conventions.entityFieldNameConvention = 'camel';
store.initialize();

const eventGridTrigger: AzureFunction = async function (context: Context, eventGridEvent: any): Promise<void> {
    const buffer = Buffer.from(certificate.value, 'base64');
    const repository = new DocumentRepository(store);

     ...the rest...
};

export class Doc…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dtaalbers
Comment options

Answer selected by ayende
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants