Home > Database > Mysql Tutorial > 如何把 正则表达式 存储到 mongodb 里面(mongoid)

如何把 正则表达式 存储到 mongodb 里面(mongoid)

WBOY
Release: 2016-06-07 16:31:07
Original
1435 people have browsed it

Mongoid 的 里面有 Regexp 的 类型 我定义如下 field :name_reg, :type = Regexp 运行却报错,请教一下 ,如何把 正则表达式存储到 mongodb 里面 ××××××××××××××× Routing Error undefined method `instantiate' for Regexp:Class Try runnin

Mongoid 的 里面有 Regexp 的 类型

我定义如下

field :name_reg, :type => Regexp

运行却报错,请教一下 ,如何把 正则表达式存储到 mongodb 里面
×××××××××××××××
Routing Error

undefined method `instantiate' for Regexp:Class
Try running rake routes for more information on available routes.
×××××××××××××××××

Below is a list of valid types for fields.

Array
BigDecimal
Boolean
Date
DateTime
Float
Hash
Integer
Moped::BSON::ObjectId
Moped::BSON::Binary
Range
Regexp
String
Symbol
Time
TimeWithZone

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template