Ionic offline support

How can i build ionic ios app which supports saving offline data. I need data to be save in mongodb?