我有一个"用户"表,这里有一个示例:
{
username:"haddox",
formattedPhoneNumber:"676767676",
verified: 0,
}
Run Code Online (Sandbox Code Playgroud)
我的愿望是检索formatPhoneNumber包含在电话号码数组中的所有用户(从我的联系人中检索).我创建了一个二级索引,验证为HASH,formattedPhoneNumber为RANGE.这是我的尝试:
var params = {
TableName: "Users",
IndexName: "FormattedPhoneSecondaryIndex",
KeyConditionExpression: "verified = :v AND formattedPhone IN :n",
ExpressionAttributeValues: {
":v":1,
":n": ["672053916", "642117296"]
},
ProjectionExpression: "username, formattedPhoneNumber"
};
dynamodb.query(params, function(err, data) {
if (err)
console.log(JSON.stringify(err, null, 2));
else
console.log(JSON.stringify(data, null, 2));
});
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误: Invalid KeyConditionExpression: Syntax error; token: \":n\", near: \"IN :n\"",
IN关键字有问题吗?也许有另一种方法来实现这一目标?
我正在玩ARKit,我想从ARSKView帧创建一个视频.我尝试使用ReplayKit,但行为不是我所期望的: - 我不想记录整个屏幕. - 我不希望提示用户我们正在录制屏幕.
另外,我如何结合微输入和视频?我想在ARSKView中没有流式传输音频?这是代码(来自Apple示例):
import UIKit
import SpriteKit
import ARKit
class ViewController: UIViewController, ARSKViewDelegate {
@IBOutlet var sceneView: ARSKView!
override func viewDidLoad() {
super.viewDidLoad()
// Set the view's delegate
sceneView.delegate = self
// Show statistics such as fps and node count
sceneView.showsFPS = true
sceneView.showsNodeCount = true
// Load the SKScene from 'Scene.sks'
if let scene = SKScene(fileNamed: "Scene") {
sceneView.presentScene(scene)
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Create a session configuration
let configuration = …Run Code Online (Sandbox Code Playgroud) 我正在尝试像摄像机视图一样做一个像摄像机视图,相机流填充所有屏幕.
这是代码:
func beginSession() {
var err : NSError? = nil
// try to open the device
let videoCapture = AVCaptureDeviceInput(device: captureDevice, error: &err)
if err != nil {
// Fail silently. Do better in the real world.
println("Capture session could not start: \(err?.description)")
return
}
// add video input
if captureSession.canAddInput(videoCapture) {
captureSession.addInput(videoCapture)
}
// config capture session
if !captureSession.running {
// set JPEG output
stillImageOutput = AVCaptureStillImageOutput()
let outputSettings = [ AVVideoCodecKey : AVVideoCodecJPEG ]
stillImageOutput!.outputSettings = outputSettings …Run Code Online (Sandbox Code Playgroud)