sow-and-sub-aggregated
Including the basic AMPS library:
using AMPS.Client;
using AMPS.Client.Message;
using AMPS.Client.Exceptions;
Constructing the command:
Command cmd = new Command(Message.Commands.SOWAndSubscribe)
.setTopic(topic)
.setOptions(Message.Options.Projection("/id as /id, COUNT(/values) as /valueCount") +
Message.Options.Grouping("/id") +
Message.Options.OOF )
;
The command can now be used in execute or executeAsync.