Getting Error message while trying to use Distinct "errmsg" : "distinct too big, 16mb cap",

I am trying to use db.collectioname.distinct(‘N_id’) where collection has 51,095,935 documents .
we have unique index on ‘N_id’ .when i use the above query im getting “errmsg” : “distinct too big, 16mb cap”,

Rewrite as:
db.collectioname.aggregate({$group: {_id: "$N_id"}})