string - readStartDocument 只能在 CurrentBSONType 为 DOCUMENT 时调用,不能在 CurrentBSONType 为 STRING 时调用 错误?
问题描述
我的代码如下所示,我应该怎么做才能避免这个错误?
@RequestMapping(method = RequestMethod.POST, path = "/deneme", consumes = "application/json")
public void logout(@RequestBody Map<String, Object> userId) {
tokensService.logout(userId.get("userId").toString());
}
public void logout(String userId){
try {
tokensRepository.logout(userId,"");
}
catch (Exception e) {
System.out.println(e.getMessage());
}`public interface TokensRepository extends MongoRepository<Tokens, String> {
@Query("Update tokens t set t.token=:token where t._id=:userId")
void logout(@Param("userId") String userId, @Param("token") String token);
}`
解决方案
推荐阅读
- html - Bootstrap 4 - 部分下一张幻灯片上的光滑滑块渐变效果
- java - 将 JSON 转换为对象抛出 JsonMappingException “无法反序列化类实例出 START_ARRAY 令牌”
- docker - ForgeRock 产品(即 AM、IDM、DS 和 IG)在 Docker 容器中使用的最佳操作系统是哪个?
- css - 我在 hompage 上的字体工作正常,但在其他页面上却没有
- docker - 如何获取在容器中运行的进程的主机 pid?
- kotlin - 可以从 Kotlin 的列表中弹出一个元素吗?
- java - 当它们在库中时,如何使带有 Springboot 注释的类正确加载?
- eigen - 在 Eigen 中,是否可以从其 Column 主要表示构造一个 Eigen::sparseMatrix ?
- android - 浮动操作按钮未执行 OnClick
- mysql - 在 MySQL 查询中使用 UTF8 编码的字符串