Newbie: Using $mod method during insert in mongodb
<p>I'm sure this is the easiest question for you, but forgive me for being naive.
I have been trying to learn mongodb and wanted to experiment with some aggregation.</p>

<p>For that, I wanted to insert data into a collection like this.</p>

<p>for (i=1; i&lt;=10; i++) { db.aggtest.insert( {a : { $mod: [i, 3]}, b : i}) }</p>

<p>However this doesn't seem to work. I have tried using it for update as well, but it gives a different error for me.</p>

<p>Please help me with this.</p>

<p>Thanks
Radha</p>