Page 1 of 1

How can I create a new Tiggzi database collection via a REST service?

Posted: Mon Dec 17, 2012 2:51 pm
by Melvin Tan Gim Huat

As above. I know how to create/edit/delete an existing collection but need guidance in the creation of a new collection via a REST service.

Thanks.


How can I create a new Tiggzi database collection via a REST service?

Posted: Mon Dec 17, 2012 4:06 pm
by Maryna Brodina

Hello! Tiggzi DB is based on Mongo DB, so you can use this docs https://support.mongolab.com/entries/... (see Create collection section). Hope this will help.


How can I create a new Tiggzi database collection via a REST service?

Posted: Mon Dec 17, 2012 4:37 pm
by Maryna Brodina

Hello! It's not possible.


How can I create a new Tiggzi database collection via a REST service?

Posted: Wed Dec 19, 2012 3:29 pm
by Melvin Tan Gim Huat

Hi Marina,

Why is this not possible?

Saw the below from Mongo DB which suggests that this should be possible. I created a POST REST service in Tiggzi using the logic below. It did not work but that could be due to some syntax error.

Thanks...

---------------------------------- From Mongo DB ----------------------------------------------
Create collection
To create a new collection, just start using it! Just like using a standard driver or the shell, collections are created implicitly just by using them. As soon as you POST your first document you should see the collection appear.

------------------------------------------------------------------------------------------------------

How can I create a new Tiggzi database collection via a REST service?

Posted: Wed Dec 19, 2012 3:39 pm
by Maryna Brodina

Ok, thank's for an update and sorry for this misunderstanding:)


How can I create a new Tiggzi database collection via a REST service?

Posted: Wed Dec 19, 2012 4:31 pm
by maxkatz

Let me add this.

If your question was whether you can make a POST request to a Tiggzi database - absolutely yes. If your question was whether you can create a new collection by sending a POST request - then the answer is no. Although MongoDB does allows that - our API doesn't allow it to minimize errors. It would very easy to send the wrong collection name or the wrong field name in the POST.


How can I create a new Tiggzi database collection via a REST service?

Posted: Fri Dec 21, 2012 3:31 pm
by Melvin Tan Gim Huat

Max, while I understand your logic, it seems that this restriction limits the flexibility of the app to cater to different needs.

Take my requirement as an example. I need to be able to create a new collection via a REST service whenever a user creates a new "record/entry" using the app. That's because other users can view this record/entry and in the process, like/dislike and post comments. These likes/dislikes as well as comments to be tagged to the users who posted them.

Anyway, looks like I either have to find a non-Tiggzi database to use or try to find an alternative solution to meet this requirement if I continue using the Tiggzi database. If you have any Database 101 readings to recommend, I'll appreciate that as well. Thanks for hearing my feedback and providing your support.


How can I create a new Tiggzi database collection via a REST service?

Posted: Fri Dec 21, 2012 4:44 pm
by maxkatz

Could you create the collection up front?


How can I create a new Tiggzi database collection via a REST service?

Posted: Sat Dec 22, 2012 5:31 am
by Melvin Tan Gim Huat

That was my earliest idea. However, it will not work as users need to be able to create new entries/records on the fly.


How can I create a new Tiggzi database collection via a REST service?

Posted: Sat Dec 22, 2012 5:37 am
by maxkatz

Well, you can still create new entries/records, you would just need to create the actual collection first.