Hi @colllin,
You can do that with Insert()
> CreateCollection({name:'insert'})
{ ref: Collection("insert"),
ts: 1605256817275000,
history_days: 30,
name: 'insert' }
>
>
>
> Insert(Ref(Collection("insert"), "1"),ToMicros(TimeSubtract(Now(),10,'days')),'create',{data:{val1:1,val2:2}})
{ ts: 1604392825587992,
action: 'create',
document: Ref(Collection("insert"), "1"),
data: { val1: 1, val2: 2 } }
>
> Insert(Ref(Collection("insert"), "1"),ToMicros(TimeSubtract(Now(),9,'days')),'update',{data:{val1:10,val2:20}})
{ ts: 1604479234489172,
action: 'create',
document: Ref(Collection("insert"), "1"),
data: { val1: 10, val2: 20 } }
>
> Insert(Ref(Collection("insert"), "1"),ToMicros(TimeSubtract(Now(),8,'days')),'update',{data:{val1:100,val2:200}})
{ ts: 1604565640903046,
action: 'create',
document: Ref(Collection("insert"), "1"),
data: { val1: 100, val2: 200 } }
>
>
> Insert(Ref(Collection("insert"), "1"),ToMicros(TimeSubtract(Now(),7,'days')),'delete',{data:{val1:100,val2:200}})
{ ts: 1604652047206858,
action: 'delete',
document: Ref(Collection("insert"), "1"),
data: null }
>
>
> Paginate(Events(Ref(Collection("insert"), "1")))
{ data:
[ { ts: 1604392825587992,
action: 'create',
document: Ref(Collection("insert"), "1"),
data: { val1: 1, val2: 2 } },
{ ts: 1604479234489172,
action: 'update',
document: Ref(Collection("insert"), "1"),
data: { val1: 10, val2: 20 } },
{ ts: 1604565640903046,
action: 'update',
document: Ref(Collection("insert"), "1"),
data: { val1: 100, val2: 200 } },
{ ts: 1604652047206858,
action: 'delete',
document: Ref(Collection("insert"), "1"),
data: null } ] }
>
>
>
> Paginate(Documents(Collection("insert")))
{ data: [] }
>
>
> At(1604479234489172,Paginate(Documents(Collection("insert"))))
{ data: [ Ref(Collection("insert"), "1") ] }
> At(1604479234489172,Get(Ref(Collection("insert"), "1")))
{ ref: Ref(Collection("insert"), "1"),
ts: 1604479234489172,
data: { val1: 10, val2: 20 } }
Is that what you are looking for?
Luigi