keystonejs

Keystone.js Not able to upload same file again

百般思念 提交于 2019-12-25 07:43:06
问题 I am uploading the same name file again but it is showing 'Field Error '. I have checked the log it is due to unique File name error . But I do not want to change the name of the file . Anyone having any solution for that. I am using keystone framework 来源: https://stackoverflow.com/questions/42974929/keystone-js-not-able-to-upload-same-file-again

How to make an ADF XML format be assigned to a variable without getting unxpected token error

半城伤御伤魂 提交于 2019-12-24 23:18:32
问题 I have a program where in it will send an email. I used keystone js (node) on the backend and then nunjucks on the front end. I want to send an email in ADF XML format. I wanted to assign that adf xml to bodyContent without receiving unexpected token error.That is how adf xml has to be sent and that contain dynamic data. adf xml <?xml version="1.0" encoding="UTF-8"?> <?ADF VERSION="1.0"?> <adf> <prospect> <id sequence="yourLeadID" source="site name"></id> <requestdate>2013-03-15T8:22:40<

KeystoneJS file upload not working in my app

夙愿已清 提交于 2019-12-24 14:51:11
问题 We are working with a client, that uses Keystonejs 0.3.16, on providing the possibility to upload files to the server file system (Not from the keystone admin ui). At first hand, this seemed trivial and I expected this to be working in less than an hour. After having worked on this until after midnight, motivated by the fact that I will sleep much better once this is sorted, I had to resign for the time being and indeed, my dreams where unsettled as a consequence. What a geek you must think,

How to alter a value before storing it to the database in Keystone JS

江枫思渺然 提交于 2019-12-23 05:29:27
问题 Keystone and mongo are both new to me, so I'm unsure how to manipulate data. I have a Keystone list which has a model ( /models/Game.js ) that looks like: var keystone = require('keystone'); var Types = keystone.Field.Types; var Game = new keystone.List('Game'); Game.add({ odds: { type: Types.Text, required: true, initial: true}, }); Game.track = true; Game.defaultSort = '-createdAt'; Game.defaultColumns = 'odds'; Game.register(); The odds field is a string, e.g. 3/1 , and I want to run this

MongoError: not authorized on to execute command { find: “app_updates”, filter: { key: “0.0.1-admins” }, limit: 1, batchSize: 1, singleBatch: true }

。_饼干妹妹 提交于 2019-12-23 02:43:20
问题 I start a KeystoneJS project following this method. But after entering the project root directory and running node keystone.js I receive the error: ------------------------------------------------ An error occurred applying updates, bailing on Keystone init. Error details: MongoError: not authorized on <KeystoneJS project name> to execute command { find: "app_updates", filter: { key: "0.0.1-admins" }, limit: 1, batchSize: 1, singleBatch: true } I researched on this error but I couldn't

Mongoose two level population using KeystoneJs [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-22 22:39:08
问题 This question already has answers here : Populate nested array in mongoose (11 answers) Closed 4 years ago . I need to populate two levels down with Mongoose / Keystone, but have hit a road block. I have 3 models: Region, Country and City. Regions contains countries and countries contain cities. My models: Model Region: var Region = new keystone.List('Region'); Region.add({ name: {type: Types.Text} , countries: {type: Types.Relationship, ref: 'Country', many: true} }); Model Country var

Keystone JS , what field type we can you on saving an array of objects

戏子无情 提交于 2019-12-20 05:37:49
问题 In my program I generated an array of objects which is the ImageData , Now I want to save that data to mongo Db , I have no problem with other Keys except the ImageData key because I dont know what field type to use to be able to insert those data below which are an array of objects . What field type in keystone we could use to save those array of object example below ?. Thank you. Data Model , this is the model , I tried using Text array but it does not seem to work. Data.add({ name: { type:

iterate over an array of objects in jade/pugjs

…衆ロ難τιáo~ 提交于 2019-12-18 14:52:15
问题 I have the following json object: var partners =[{ "name":"partnerx", "image": "imagex" }, { "name": "partnery", "image": "imagey" }] I want to put into a ul object using jade and I tried: ul#slides.swiper-wrapper mixin partners(name, image) li.swiper-slide img(src=#{image} , alt=#{name}) This is not working. 回答1: Try this: ul#slides.swiper-wrapper each partner in partners li.swiper-slide img(src=partner.image, alt=partner.name) https://pugjs.org/language/iteration.html 来源: https:/

iterate over an array of objects in jade/pugjs

依然范特西╮ 提交于 2019-12-18 14:51:37
问题 I have the following json object: var partners =[{ "name":"partnerx", "image": "imagex" }, { "name": "partnery", "image": "imagey" }] I want to put into a ul object using jade and I tried: ul#slides.swiper-wrapper mixin partners(name, image) li.swiper-slide img(src=#{image} , alt=#{name}) This is not working. 回答1: Try this: ul#slides.swiper-wrapper each partner in partners li.swiper-slide img(src=partner.image, alt=partner.name) https://pugjs.org/language/iteration.html 来源: https:/

Mongo connection closed in keystonejs app

自作多情 提交于 2019-12-13 05:14:25
问题 For my keystonejs project I have created two docker containers (one for mongo, one for the keystonejs app). All works well, with the exception that I am getting very often a "connection closed" error when browsing the site (usually when I haven't navigated for a couple of minutes). The full error stack is below: Error thrown for request: /blog Error: connection closed at null.<anonymous> (/usr/src/app/node_modules/keystone/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection