假设我有类似的架构
fname: string
lname: string
age: string
Run Code Online (Sandbox Code Playgroud)
它们都不是必需的.用户可以向我发送上述任何属性,但任何其他未声明的属性.他们可以通过我fname
,lname
和age
或全部.但是,如果他们通过我所有和middle_name
消息的其他财产应该被拒绝.
我该如何定义这样的架构?
我在下面有这个代码片段(离子框架),但routeChangeStart
在我浏览时不打印.
.run(function($ionicPlatform, $rootScope, $location) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
$rootScope.$on('$routeChangeStart', function(event, next, current) {
console.info('[event] routeChangeStart...');
});
})
Run Code Online (Sandbox Code Playgroud) 路径看起来像这样
\\10.1.10.11\Results\\filename.rtf
Run Code Online (Sandbox Code Playgroud)
从我的机器,我可以通过将其粘贴到Run
框中来访问它,输入用户名和密码.
我试过smb2
(smb2),但示例代码只是挂起,过了一会儿,我得到了Error: read ECONNRESET
.
我需要在linux和windows上使这个工作.
如果我在中保留network.host
注释/etc/elasticsearch/elasticsearch.yml
,它将像正常一样开始(curl localhost:9200
返回预期结果)。
但是,如果我设置了它,network.host = <public-ip>
那么sudo service elasticsearch restart
它会说OK,但是elasticsearch的状态是not running
。
在这种情况下我做错了什么?
系统:Ubuntu 14.04 LTS
更新:通过将其绑定到进行修复0.0.0.0
。
根据this,没有等效的语法吗?
有办法实现这个目标吗?
例子
{ ...
attrib1: {},
attrib2: []
...
}
Run Code Online (Sandbox Code Playgroud)
当我在attrib2
路径中循环时,我想从 获取一些信息attrib1
。在这种情况下我该怎么做?
如果我在这里错了,请纠正我.这就是我的工作
client = Promise.promisifyAll(redis.createClient())
let reply = await client.getAsync('foo_rand000000000000')
console.log('reply',reply.toString())
Run Code Online (Sandbox Code Playgroud)
我收到了Unexpected token
错误.
我有这个 .babelrc
{
"presets": [
"es2015",
"stage-3"
]
}
Run Code Online (Sandbox Code Playgroud)
有人可以指出我在这里做错了什么.
我正在使用bluebird来初始化各种类型的数据库连接.
// fileA.js
Promise.all(allConnectionPromises)
.then(function (theModels) {
// then i want to do module.exports here
// console.log here so the expected output
module.exports = theModels
})
Run Code Online (Sandbox Code Playgroud)
这样我就可以从另一个文件中请求上面的文件.但如果我这样做,我会{}
.
let A = require('./fileA') // i get {} here
Run Code Online (Sandbox Code Playgroud)
知道怎么做吗?
node.js ×3
angularjs ×1
async-await ×1
babeljs ×1
bluebird ×1
json ×1
jsonpath ×1
jsonschema ×1
promise ×1
validation ×1