LargeDatasetGenerator usage example

I’m trying to use LargeDatasetGenerator from couchbaselabs/ couchbase-mobile-tools repo.

Does anyone can share some usage example? I’ve been able to build and run it, also generating data from plain json works out of the box, but I’m unable to understand how to use mustache-like template to generate different data in each document.

Found an example here

This is based almost entirely on this website FYI. There are a lot of functions there so not everything is implemented but you can see some explanation in the help section.

Thank @borrrden to pointing me to the right documentation, the new version of the website lacks of docs. I also discovered that by running
dotnet bin/Debug/netcoreapp2.1/LargeDatasetGenerator.dll --list-generators
you get the list of functions you can use in your template, with a short description of their behavior.

I my fork of mobile tools repo (progress-propagation branch) I added a couple of functions to have dates sequentially generated in a range of dates.

progressivedate: Randomly generates a date between the given min and max**
{{progressivedate(min: Date = new Date(1970, 1, 1, 0, 0, 0), max: Date = new Date())}}**

progressiveday: Randomly generates a day (yyyyMMdd) between the given min and max**
{{progressiveday(min: Date = new Date(1970, 1, 1, 0, 0, 0), max: Date = new Date())}}**

If there’s some kind of interest in them, I’ll consider to open a pull request to merge them in develop branch of main repo.

I wrote this tool but forgot that I put that in :smiley: . I’d be happy to accept a pull request but how is progressivedate different than date ?

Hi @borrrden, while date outputs a random date, progressivedate spreads dates uniformly and predictably between start and end date. This enabled me to save two different functions to to output the same date in different formats (for example we use a shorter date field yyyyMMdd in our docs as index for making queries faster and reduce indeed size).

Another cool feature I’d like to introduce would be to have the template itself and the generated doc itself inside generators, to be able to generate values starting from other fields.

Those sound like nice features. One comment I’d have is that it would be good to combine all the different date functions into one so that things don’t get overly complicated for someone using the program (“Which date function should I use again?”). Send a PR if you like.