I am using StrongLoop to create REST style api from an existing MYSQL database which is a wordpress database. The existing MYSQL db has two table names 'wp_post
' and 'wp_postmeta
'
wp_post table | wp_postmeta | ------------------------|-----------------| ID | meta_id | ------------------------|-----------------| post_content | meta_key | ------------------------|-----------------| post_title | meta_value | ------------------------|-----------------| post_date_gmt | post_id | ------------------------|-----------------| post_status | ------------------------| comment_status | ------------------------| post_modified | ------------------------| post_modified_gmt | ------------------------| comment_count | ------------------------| more feild ... | ------------------------|The wp_postmeta has meat_key and meta_value pair such as (
vote_up, vote_down,featured, view_count
) which are directly related to the post. Using these two table i want to create a model in StrongLoop with following schema named book
:
Id, title, content, post_date, comment_count, vote_up, vote_down, featured, view_count
. Is it possible to created such model in StrongLoop? if yes how can i handle the CRUD operation on such a model?
I have been looking all over the internet for some example but did not find any. Any help is appreciate! Thanks!