Last active
August 29, 2015 14:19
-
-
Save pgharios/db920c5da7b3af7b3c67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| result = client[:'userTable'].find("token" => token).update_one( "$pull" => { "subscribedTo" => topic } ) | |
| 70 client[:'userTable'].find("token" => token).projection(:arn => 1).each do |document| | |
| 71 @subscriberARN = document["arn"] | |
| 72 resp = sns.list_subscriptions | |
| 73 resp.subscriptions.each do |x| | |
| 74 if (x["endpoint"] == @subscriberARN && x["topic_arn"] =~ /#{topic}/) then | |
| 75 p "bingo, priting sub arn" | |
| 76 p x["subscription_arn"] | |
| 77 sns.unsubscribe(subscription_arn: "#{x["subscription_arn"]}") | |
| 78 end | |
| 79 end | |
| ERROR TypeError: can't convert BSON::Documen[2015-04-16 10:55:59] ERROR TypeError: can't convert BSON::Document into String | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:114:in `block in service' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `block in each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:113:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' | |
| /usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' | |
| [2015-04-16 10:55:59] ERROR TypeError: can't convert BSON::Document into String | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:114:in `block in service' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `block in each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:113:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' | |
| /usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' | |
| result = client[:'userTable'].find("token" => token).update_one( "$pull" => { "subscribedTo" => topic } ) | |
| client[:'userTable'].find("token" => token).projection(:arn => 1).each do |document| | |
| @subscriberARN = document["arn"] | |
| resp = sns.list_subscriptions | |
| resp.subscriptions.each do |x| | |
| if (x["endpoint"] == @subscriberARN && x["topic_arn"] =~ /#{topic}/) then | |
| p "bingo, priting sub arn" | |
| p x["subscription_arn"] | |
| sns.unsubscribe(subscription_arn: "#{x["subscription_arn"]}") | |
| [2015-04-16 10:55:59] ERROR TypeError: can't convert BSON::Document into String | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:114:in `block in service' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `block in each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/mongo-2.0.2/lib/mongo/cursor.rb:78:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/body_proxy.rb:31:in `each' | |
| /var/lib/gems/1.9.1/gems/rack-1.6.0/lib/rack/handler/webrick.rb:113:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' | |
| /usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' | |
| /usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' | |
| t into String ERROR TypeError: can't convert BSON::Document into String | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment