I am inserting certain rows in backand with my own custom id in the the id field, on checking the database I see that the id is changed to backand's own id which starts from 1,2,3... sequentially. I want my original ids to be retained, the documentation does not mention about this. Please help.
RESPONSE to Matts answer:
My question clearly states that I dont want to 'create' new ids, I want to retain my original ids which I have sent. After going through Backand's awful documentation for the nth time I could not see this issue addressed. I personally find it silly that Backand thinks that the id provided by the user ( which often requires quite heavy algo, to maintain uniqueness and randomness is not good) and their super cool auto incremental integers 1,2,3.. are better primary key, hence overrides the clients ids. All the support people repeat the same line as Matt like a parrot without even understanding my specific requirement. No. I cannot create random ids from backand because the same ids are mapped to other systems. And please for Gods sake, fix your documentation. NOWHERE is it mentioned that it will override the ids.
For Ex: Firebase first checks for user provided id, if it is there it doesnt touch it, if its not there, it creates its own, but i can't use firbase for its own limitations, switching over to Mongo hope that should help.
thanks for using Backand. You can use the technique described in our documentation on using UUIDs as primary keys for an object: http://docs.backand.com/#using-uuid-primary-keys
By following this approach, you'll be able to set the IDs to anything you want. Otherwise, all ID fields will be overwritten when you send them to the API with an autoincrementing integer. If you override these in a custom action on create, you can bypass this behavior on creation.
EDIT - As a follow-up to this, one technique to get around Backand's auto overriding of the data is to access the database and remove the ID column, marking another in the table as the primary key instead. Backand takes control of the name field in order to drive some of the autocompletion functionality. By deleting the ID field and changing the primary key, or simply removing the auto constraint we put on the ID field, you should be able to achieve what you need. This isn't possible through the UI, though - it should be done via connecting directly to your database using a tool like MySQL Workbench. The information needed to connect your database is available from the Backand App Dashboard, under Settings -> Database
Also, regarding the originally suggested solution, it's important to note that I wasn't stating to apply this blindly. As I mentioned, using the approach described - creating a custom action to drive the ID created - can be adapted to populate any ID field you desire. In the sample code, instead of generating a GUID, you can instead copy the value from another field on the object that provides the ID, or really do anything you want with it. The key, though, is the update of the underlying database column to remove the auto-increment population and change the data type to the correct value. I've adjusted the documentation to include a mention of this.