Good day. Just started to learn Swift (in Xcode ) and faced with "incomprehension". How to work with MongoDB in Swift ? I found various libraries on a githaba, but I could not figure out how they connect to the project. And is there a way to work with libraries as java&gradle ?

I would be very grateful for the help.

Closed due to the fact that the essence of the issue is incomprehensible by the participants of Kromster , cheops , aleksandr barakin , user194374, Bald July 14, '16 at 4:00 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    I recommend writing a simple REST service in Java or Python to access MongoDB data. It is much easier than to make a direct connection with Swift and from an architectural point of view it is much more correct.

    • Apparently this is really the "only" reasonable solution. I tried to work with Package Manager, but in the end he throws out a bunch of errors about not found libraries. Compile Swift Module 'BinaryJSON' (9 sources) /Users/alekseyskynox/Downloads/test/Packages/CBSON-1.1.1/module.modulemap:2:12: error: header '/usr/local/include/libbson-1.0/bson.h' not found header "/usr/local/include/libbson-1.0/bson.h" I tried to put everything according to the instructions, but in the end, all the same, such errors are born. Apparently Swift is not yet ready for such projects, or my knowledge does not pull :) - Aleksey Pleshkov
    • Did I understand correctly - Swift is not suitable for server-side development? - Aleksey Pleshkov
    • Yes, unfortunately so far it is. I did not meet adequate libraries for direct work with MongoDB and MySQL. - Ivan Kramarchuk