How do I add the moment.js library to Cloudant NoS

2019-08-04 06:13发布

Just learning Cloudant NOSQL on Bluemix. I have been successful adding my weather data to the database, simple queries, and even pulling it out to a mobile app using Kinetise. I am not a SW developer,but I am an engineer.

I need to access the moment.js date math capability as I believe this will help me sum weather station data over the last 24hours, 7days, and 30d relative to the current moment in time. I though this would be easy not knowing any better. Clearly you need to saddle up when doing anything beyond the basic with Javascript dates/time.

I am trying to create a map that uses moment.js math capabilities and can't figure out how to include that library. I saw bits and pieces of 'lib' and 'require' necessity and just need help very exactly on how to do it. Reviewed CouchdB site as well and I just don't get it.

1条回答
孤傲高冷的网名
2楼-- · 2019-08-04 06:53

you may want to review/follow the instructions here:

http://www.swarmforest.com/blog/how-to-use-js-libs-like-underscorejs-in-your-couchdb-views/

there are also multiple answers here:

How do I DRY up my CouchDB views?

which may be worth reviewing.

查看更多
登录 后发表回答