It'll certainly work. With the right hardware and properly threaded inserting, it could work on 1 system, but you'll probably want more.
It seems like what you really have is the most raw form of a key/value store, if A is unique. If not, you may still benefit from a less capable system, as your query and data is so simple. You could fairly easily make a SQL database do what you want as well, so this isn't a problem that Mongo will help with beyond the fact that if your data gets bigger, you'll want sharding / scaling capabilities that are much easier in Mongo than in SQL databases (mysql being the easiest, but still painful).
Our company has worked with sql, couchbase,
elastic.co, redis, memcache and many other key value stores. We prefer mongo, but it's not always the answer. Nearly all of those would probably also work. These are all also very easy to test. I suggest running performance test on a few of them with a sample of your data and choosing the one that works best.