modified  the first select (insert os a device) to work correctly with
jdbc implementation of mongo driver