Redundant mirroring of two mongodb servers
You'll need to find a different approach as there are a few major assumptions that won't work.


  The solution I am going to implement for my client is that I will set up a Raspberry Pi that will run the same web application locally at their shop


Raspberry Pi 1/2 (with 32-bit ARM CPU) is not an officially supported platform for MongoDB, nor is it likely to be. The MMAP storage engine (which is the only 32-bit storage engine available for MongoDB) also has a limitation of ~2GB of data on 32-bit deployments as per the underlying MMAP API. There are some community builds which might be passable for development use, but I wouldn't recommend for client/production work.

There is progress toward experimental 64-bit ARM support in the MongoDB 3.3 development branch, so support for Raspberry Pi 3 or newer is an eventual possibility. If you want to run a full-featured web application with minimal compatibility hassle, a small form factor 64-bit x86 computer is a better bet for current deployments.


  So basically, I need the Pi to be a slave, which becomes master when no inet, and writes to the master when the inet is back up


This isn't a supported replication model as at MongoDB 3.2; a replica set can only have a single primary which accepts writes. An offline/disconnected secondary would be read-only.


  "What happens when I lose my internet connection?".


Some other approaches to consider:


Set up a backup internet connection. This will minimise complexity since you don't have to worry about conflicting versions of data or applications.
Look into a different local storage solution for offline writes which is also more suited for embedded / low power devices (for example, SQLite). You'll have to work out how to resolve data editing conflicts between local &amp; web data, though.