Major - P3
5 nodes with :
OS: RHEL 7.2 x64
CPU CORE COUNT: 5
NIC: 1000 Mbps
I got the "codeName" : "CommandNotSupportedOnView" error while doing aggregation on views. This occurs from time to time, most often when right after importing lots of data. For now, it seems that restarting the mongos will fixed it temporarily.
view creation info from system.views:
1. I also get the same error doing db.view.count(), but db.view.find() seems fine.
2. Only restarting mongos can fix it, db.runCommand("flushRouterConfig") doesn't work.
3. Sometimes the aggregation/count() would be working fine, but failed the next minute/second, and after a while it would miraculously recover.
I have some views whose data needs to do a full collection refresh every day, for example there's a collection named "COL", I import the new data to a new collection name "COL_20180115" on 2018-01-15, then recreate the view named "COL" pointing to the daily new collection. Since renaming collection was not supported on sharded collections, using views was the only option I came up with.